環境変数¶
以下は、xonshのパフォーマンスに何らかの影響を与える環境変数に関する情報を表示します。また、該当する場合はデフォルト値のリストも表示されます。
リスト¶
$ AUTO_CD ¶
dirnameまたはフルパスのみを入力して(cdコマンドなしで)ディレクトリに変更できるようにするフラグ。
設定可能: True
デフォルト: False
store_as_str: False
$ AUTO_SUGGEST ¶
魚のシェルのように、履歴に基づいた自動コマンド提案を有効にします。
右矢印キーを押すと、現在表示されている候補が挿入されます。使用可能なのは$SHELL_TYPE=prompt_toolkit.
設定可能: True
デフォルト: True
store_as_str: False
$ AUTO_SUGGEST_IN_COMPLETIONS ¶
補完結果の最初のオプションとして自動提案結果を配置します。これにより、自動提案のタブをタップすることができます。
設定可能: True
デフォルト: False
store_as_str: False
$ BASH_COMPLETIONS ¶
これは、bash_completion
スクリプトが見つかる場所を指定する文字列のリスト(またはタプル)です。最初の有効なパスが使用されます。bash-completion v2.xは、個々の補完スクリプトを遅延ロードするため、パフォーマンスを向上させるために推奨されています。bash-completion v1.xとv2.xの両方で、個々の補完スクリプト(のような.../completes/ssh
)のパスをここに含める必要はありません。デフォルト値はプラットフォームに依存しますが、正常です。代替リストを指定するには、実行制御ファイルで代替リストを指定します。
設定可能: True
デフォルト:通常これは:
('/usr/share/bash-completion/bash_completion', )
しかし、Macではそれは:
('/usr/local/share/bash-completion/bash_completion', '/usr/local/etc/bash_completion')
他のOS固有のデフォルトが将来追加される可能性があります。
store_as_str: False
$ BOTTOM_TOOLBAR ¶
下のツールバーのテンプレート文字列。これは、$PROMPT
変数と同じ方法でパラメータ化することができます。現在のところ、これはプロンプトツールキットシェルでのみ利用可能です。
設定可能: True
デフォルト: ''
store_as_str: False
$ CASE_SENSITIVE_COMPLETIONS ¶
補完で大文字と小文字を区別するか、大文字と小文字を区別するかを設定
設定可能: True
デフォルト: LinuxではTrue、それ以外の場合はFalse。
store_as_str: False
$ CDPATH ¶
CDのルーツとして使用されるパスのリストは、Bash、xonshとの互換性を失うため、常に既存の相対パスが優先されます。
設定可能: True
デフォルト:()
store_as_str: False
$ COMPLETIONS_BRACKETS ¶
Pythonの属性補完で角かっこと括弧を含めるかどうかを示すフラグ。
設定可能: True
デフォルト: True
store_as_str: False
$ COMPLETIONS_CONFIRM ¶
タブ補完メニューが表示されている間、<Enter>を押してコマンドを実行するのではなく完了を確認します。これはプロンプトツールキットシェルにのみ影響します。
設定可能: True
デフォルト: False
store_as_str: False
$ COMPLETIONS_DISPLAY ¶
Python補完がprompt_toolkit
シェルによって表示されるかどうかを設定します。
このオプションは、Bash補完、自動提案などには影響しません。
実行時に変更するとすぐに反映されるため、シェルセッション中に完了をすばやく無効にして有効にすることができます。
- 場合
$COMPLETIONS_DISPLAY
であるnone
かfalse
、それらの補完を表示しません。 - 一致する場合
$COMPLETIONS_DISPLAY
はsingle
、入力中に1つの列に補完を表示します。 - 複数の列に入力中にor が表示されている場合
$COMPLETIONS_DISPLAY
は、補完を表示します。multi
true
- 場合
$COMPLETIONS_DISPLAY
でreadline
、表示の完了は、readlineのの動作をエミュレートします。
これらのオプションの値はそうegwriting、タイプ、大文字と小文字は区別またはされていないと等価です。使用可能なのは$COMPLETIONS_DISPLAY = None
$COMPLETIONS_DISPLAY = 'none'
$SHELL_TYPE=prompt_toolkit
設定可能: True
デフォルト: 'multi'
store_as_str: False
$ DOTGLOB ¶
"*"または "**"のファイルをグロビングすると、ドットファイル、またはリテラル '。'で始まる名前のファイルが一致します。そのようなファイルは、デフォルトでは除外されます。
設定可能: True
デフォルト: False
store_as_str: False
$ DYNAMIC_CWD_ELISION_CHAR ¶
短縮されたcwdで短縮されたディレクトリを示すのに使用される文字列、例えば'…'
。
設定可能: True
デフォルト: ''
store_as_str: False
$ DYNAMIC_CWD_WIDTH ¶
cwd
プロンプト変数の文字数またはパーセントに対する最大長。たとえば、「20」は20文字の幅で、「10%」は使用可能な列の数の10パーセントです。
設定可能: True
デフォルト:(inf、 'c')
store_as_str: False
$ EXPAND_ENV_VARS ¶
サブプロセスモードで環境変数が文字列の内部で展開されるかどうかを切り替えます。
設定可能: True
デフォルト: True
store_as_str: False
$ FORCE_POSIX_PATHS ¶
/
trueが設定されている場合、自動補完を使用すると、Windowsシステムでスラッシュ()を強制的に実行します。
設定可能:偽
デフォルト: False
store_as_str: False
$ FOREIGN_ALIASES_OVERRIDE ¶
Whether or not foreign aliases should override xonsh aliases with the same name. Note that setting of this must happen in the environment that xonsh was started from. It cannot be set in the .xonshrc
as loading of foreign aliases happens before``.xonshrc`` is parsed
configurable: True
default: False
store_as_str: False
$FOREIGN_ALIASES_SUPPRESS_SKIP_MESSAGE¶
Whether or not foreign aliases should suppress the message that informs the user when a foreign alias has been skipped because it already exists in xonsh.
configurable: True
default: False
store_as_str: False
$FUZZY_PATH_COMPLETION¶
Toggles ‘fuzzy’ matching of paths for tab completion, which is only used as a fallback if no other completions succeed but can be used as a way to adjust for typographical errors. If True
, then, e.g., xonhs
will match xonsh
.
configurable: True
default: True
store_as_str: False
$GLOB_SORTED¶
Toggles whether globbing results are manually sorted. If False
, the results are returned in arbitrary order.
configurable: True
default: True
store_as_str: False
$HISTCONTROL¶
A set of strings (comma-separated list in string form) of options that determine what commands are saved to the history list. By default all commands are saved. The option ignoredups
will not save the command if it matches the previous command. The option ‘ignoreerr’ will cause any commands that fail (i.e. return non-zero exit status) to not be added to the history list.
configurable: True
default: set()
store_as_str: True
$IGNOREEOF¶
Prevents Ctrl-D from exiting the shell.
configurable: True
default: False
store_as_str: False
$INTENSIFY_COLORS_ON_WIN¶
Enhance style colors for readability when using the default terminal (cmd.exe
) on Windows. Blue colors, which are hard to read, are replaced with cyan. Other colors are generally replaced by their bright counter parts.
configurable: False
default: True
store_as_str: False
$LANG¶
Fallback locale setting for systems where it matters
configurable: True
default: ‘C.UTF-8’
store_as_str: False
$LOADED_RC_FILES¶
Whether or not any of the xonsh run control files were loaded at startup. This is a sequence of bools in Python that is converted to a CSV list in string form, ie [True, False]
becomes 'True,False'
.
configurable: False
default: ()
store_as_str: False
$MOUSE_SUPPORT¶
Enable mouse support in the prompt_toolkit
shell. This allows clicking for positioning the cursor or selecting a completion. In some terminals however, this disables the ability to scroll back through the history of the terminal. Only usable with $SHELL_TYPE=prompt_toolkit
configurable: True
default: False
store_as_str: False
$MULTILINE_PROMPT¶
Prompt text for 2nd+ lines of input, may be str or function which returns a str.
configurable: True
default: ‘.’
store_as_str: False
$OLDPWD¶
Used to represent a previous present working directory.
configurable: False
default: ‘<default not set>’
store_as_str: False
$PATH¶
List of strings representing where to look for executables.
configurable: True
default: (‘/home/travis/bin’, ‘/usr/local/sbin’, ‘/usr/local/bin’, ‘/usr/sbin’, ‘/usr/bin’, ‘/sbin’, ‘/bin’, ‘/usr/games’, ‘/usr/local/games’)
store_as_str: False
$PATHEXT¶
Sequence of extension strings (eg, .EXE
) for filtering valid executables by. Each element must be uppercase.
configurable: True
default: []
store_as_str: False
$PRETTY_PRINT_RESULTS¶
Flag for “pretty printing” return values.
configurable: True
default: True
store_as_str: False
$PROMPT¶
The prompt text. May contain keyword arguments which are auto-formatted, see ‘Customizing the Prompt’ at http://xon.sh/tutorial.html#customizing-the-prompt. This value is never inherited from parent processes.
configurable: True
default: xonsh.environ.DEFAULT_PROMPT
store_as_str: False
$PROMPT_FIELDS¶
Dictionary containing variables to be used when formatting $PROMPT and $TITLE. See ‘Customizing the Prompt’ http://xon.sh/tutorial.html#customizing-the-prompt
configurable: False
default: xonsh.prompt.PROMPT_FIELDS
store_as_str: False
$PROMPT_TOOLKIT_COLOR_DEPTH¶
The color depth used by prompt toolkit 2. Possible values are: DEPTH_1_BIT
, DEPTH_4_BIT
, DEPTH_8_BIT
, DEPTH_24_BIT
colors. Default is an empty string which means that prompt toolkit decide.
configurable: True
default: ‘’
store_as_str: False
$PTK_STYLE_OVERRIDES¶
A dictionary containing custom prompt_toolkit style definitions.
configurable: True
- default: {‘aborting’: ‘ansibrightblack’,
- ‘auto-suggestion’: ‘ansibrightblack’, ‘completion-menu’: ‘bg:ansigray ansiblack’, ‘completion-menu.completion’: ‘’, ‘completion-menu.completion.current’: ‘bg:ansibrightblack ansiwhite’, ‘scrollbar.arrow’: ‘bg:ansiblack ansiwhite bold’, ‘scrollbar.background’: ‘bg:ansibrightblack’, ‘scrollbar.button’: ‘bg:ansiblack’}
store_as_str: False
$PUSHD_MINUS¶
Flag for directory pushing functionality. False is the normal behavior.
configurable: True
default: False
store_as_str: False
$PUSHD_SILENT¶
Whether or not to suppress directory stack manipulation output.
configurable: True
default: False
store_as_str: False
$RAISE_SUBPROC_ERROR¶
Whether or not to raise an error if a subprocess (captured or uncaptured) returns a non-zero exit status, which indicates failure. This is most useful in xonsh scripts or modules where failures should cause an end to execution. This is less useful at a terminal. The error that is raised is a subprocess.CalledProcessError
.
configurable: True
default: False
store_as_str: False
$RIGHT_PROMPT¶
Template string for right-aligned text at the prompt. This may be parametrized in the same way as the $PROMPT
variable. Currently, this is only available in the prompt-toolkit shell.
configurable: True
default: ‘’
store_as_str: False
$SHELL_TYPE¶
Which shell is used. Currently two base shell types are supported:
readline
that is backed by Python’s readline moduleprompt_toolkit
that uses external library of the same namerandom
selects a random shell from the above on startup
best
selects the most feature-rich shell available on the- user’s system
To use the prompt_toolkit
shell you need to have the prompt_toolkit library installed. To specify which shell should be used, do so in the run control file.
configurable: True
default: best
store_as_str: False
$SUBSEQUENCE_PATH_COMPLETION¶
Toggles subsequence matching of paths for tab completion. If True
, then, e.g., ~/u/ro
can match ~/lou/carcolh
.
configurable: True
default: True
store_as_str: False
$SUGGEST_COMMANDS¶
When a user types an invalid command, xonsh will try to offer suggestions of similar valid commands if this is True.
configurable: True
default: True
store_as_str: False
$SUGGEST_MAX_NUM¶
xonsh will show at most this many suggestions in response to an invalid command. If negative, there is no limit to how many suggestions are shown.
configurable: True
default: 5
store_as_str: False
$SUGGEST_THRESHOLD¶
An error threshold. If the Levenshtein distance between the entered command and a valid command is less than this value, the valid command will be offered as a suggestion. Also used for “fuzzy” tab completion of paths.
configurable: True
default: 3
store_as_str: False
$SUPPRESS_BRANCH_TIMEOUT_MESSAGE¶
Whether or not to suppress branch timeout warning messages.
configurable: True
default: False
store_as_str: False
$TERM¶
TERM is sometimes set by the terminal emulator. This is used (when valid) to determine whether or not to set the title. Users shouldn’t need to set this themselves. Note that this variable should be set as early as possible in order to ensure it is effective. Here are a few options:
- Set this from the program that launches xonsh. On POSIX systems,
this can be performed by using env, e.g.
/usr/bin/env TERM=xterm-color xonsh
or similar. - From the xonsh command line, namely
xonsh -DTERM=xterm-color
. - In the config file with
{"env": {"TERM": "xterm-color"}}
. - Lastly, in xonshrc with
$TERM
Ideally, your terminal emulator will set this correctly but that does not always happen.
configurable: False
default: ‘<default not set>’
store_as_str: False
$TITLE¶
The title text for the window in which xonsh is running. Formatted in the same manner as $PROMPT
, see ‘Customizing the Prompt’ http://xon.sh/tutorial.html#customizing-the-prompt.
configurable: True
default: xonsh.environ.DEFAULT_TITLE
store_as_str: False
$UPDATE_COMPLETIONS_ON_KEYPRESS¶
Completions display is evaluated and presented whenever a key is pressed. This avoids the need to press TAB, except to cycle through the possibilities. This currently only affects the prompt-toolkit shell.
configurable: True
default: False
store_as_str: False
$UPDATE_OS_ENVIRON¶
If True os_environ
will always be updated when the xonsh environment changes. The environment can be reset to the default value by calling __xonsh__.env.undo_replace_env()
configurable: True
default: False
store_as_str: False
$UPDATE_PROMPT_ON_KEYPRESS¶
Disables caching the prompt between commands, so that it would be reevaluated on each keypress. Disabled by default because of the incurred performance penalty.
configurable: True
default: False
store_as_str: False
$VC_BRANCH_TIMEOUT¶
The timeout (in seconds) for version control branch computations. This is a timeout per subprocess call, so the total time to compute will be larger than this in many cases.
configurable: True
default: 0.1
store_as_str: False
$VC_HG_SHOW_BRANCH¶
Whether or not to show the Mercurial branch in the prompt.
configurable: True
default: True
store_as_str: False
$VIRTUAL_ENV¶
Path to the currently active Python environment.
configurable: False
default: ‘<default not set>’
store_as_str: False
$VI_MODE¶
Flag to enable vi_mode
in the prompt_toolkit
shell.
configurable: True
default: False
store_as_str: False
$WIN_UNICODE_CONSOLE¶
Enables unicode support in windows terminals. Requires the external library win_unicode_console
.
configurable: False
default: True
store_as_str: False
$XDG_CONFIG_HOME¶
Open desktop standard configuration home dir. This is the same default as used in the standard.
configurable: False
default: ~/.config
store_as_str: False
$XDG_DATA_HOME¶
Open desktop standard data home dir. This is the same default as used in the standard.
configurable: True
default: ~/.local/share
store_as_str: False
$XONSHRC¶
A list of the locations of run control files, if they exist. User defined run control file will supersede values set in system-wide control file if there is a naming collision.
configurable: True
default: On Linux & Mac OSX: ['/etc/xonshrc', '~/.config/xonsh/rc.xsh', '~/.xonshrc']
On Windows: ['%ALLUSERSPROFILE%\\xonsh\\xonshrc', '~/.config/xonsh/rc.xsh', '~/.xonshrc']
store_as_str: False
$XONSH_APPEND_NEWLINE¶
Append new line when a partial line is preserved in output.
configurable: True
default: <function xonsh_append_newline at 0x2b2d9aa04488>
store_as_str: False
$XONSH_AUTOPAIR¶
Whether Xonsh will auto-insert matching parentheses, brackets, and quotes. Only available under the prompt-toolkit shell.
configurable: True
default: False
store_as_str: False
$XONSH_CACHE_EVERYTHING¶
Controls whether all code (including code entered at the interactive prompt) will be cached.
configurable: True
default: False
store_as_str: False
$XONSH_CACHE_SCRIPTS¶
Controls whether the code for scripts run from xonsh will be cached (True
) or re-compiled each time (False
).
configurable: True
default: True
store_as_str: False
$XONSH_COLOR_STYLE¶
Sets the color style for xonsh colors. This is a style name, not a color map. Run xonfig styles
to see the available styles.
configurable: True
default: ‘default’
store_as_str: False
$XONSH_CONFIG_DIR¶
This is the location where xonsh configuration information is stored.
configurable: False
default: $XDG_CONFIG_HOME/xonsh
store_as_str: False
$XONSH_DATA_DIR¶
This is the location where xonsh data files are stored, such as history.
configurable: True
default: $XDG_DATA_HOME/xonsh
store_as_str: False
$XONSH_DATETIME_FORMAT¶
The format that is used for datetime.strptime()
in various placesi.e the history timestamp option
configurable: True
default: ‘%Y-%m-%d %H:%M’
store_as_str: False
$XONSH_DEBUG¶
Sets the xonsh debugging level. This may be an integer or a boolean. Setting this variable prior to stating xonsh to 1
or True
will suppress amalgamated imports. Setting it to 2
will get some basic information like input transformation, command replacement. With 3
or a higher number will make more debugging information presented, like PLY parsing messages.
configurable: False
default: 0
store_as_str: False
$XONSH_ENCODING¶
This is the encoding that xonsh should use for subprocess operations.
configurable: True
default: sys.getdefaultencoding()
store_as_str: False
$XONSH_ENCODING_ERRORS¶
The flag for how to handle encoding errors should they happen. Any string flag that has been previously registered with Python is allowed. See the ‘Python codecs documentation’ (https://docs.python.org/3/library/codecs.html#error-handlers) for more information and available options.
configurable: True
default: surrogateescape
store_as_str: False
$XONSH_GITSTATUS_*¶
Symbols for gitstatus prompt. Default values are:
XONSH_GITSTATUS_HASH
::
XONSH_GITSTATUS_BRANCH
:{CYAN}
XONSH_GITSTATUS_OPERATION
:{CYAN}
XONSH_GITSTATUS_STAGED
:{RED}●
XONSH_GITSTATUS_CONFLICTS
:{RED}×
XONSH_GITSTATUS_CHANGED
:{BLUE}+
XONSH_GITSTATUS_UNTRACKED
:…
XONSH_GITSTATUS_STASHED
:⚑
XONSH_GITSTATUS_CLEAN
:{BOLD_GREEN}✓
XONSH_GITSTATUS_AHEAD
:↑·
XONSH_GITSTATUS_BEHIND
:↓·
configurable: True
default: ‘<default not set>’
store_as_str: False
$XONSH_HISTORY_BACKEND¶
Set which history backend to use. Options are: ‘json’, ‘sqlite’, and ‘dummy’. The default is ‘json’. XONSH_HISTORY_BACKEND
also accepts a class type that inherits from xonsh.history.base.History
, or its instance.
configurable: True
default: ‘json’
store_as_str: False
$XONSH_HISTORY_FILE¶
Location of history file (deprecated).
configurable: False
default: ~/.xonsh_history
store_as_str: False
$XONSH_HISTORY_MATCH_ANYWHERE¶
When searching history from a partial string (by pressing up arrow), match command history anywhere in a given line (not just the start)
configurable: True
default: False
store_as_str: False
$XONSH_HISTORY_SIZE¶
Value and units tuple that sets the size of history after garbage collection. Canonical units are:
commands
for the number of past commands executed,files
for the number of history files to keep,s
for the number of seconds in the past that are allowed, andb
for the number of bytes that history may consume.
Common abbreviations, such as ‘6 months’ or ‘1 GB’ are also allowed.
configurable: True
default: (8128, 'commands')
or '8128 commands'
store_as_str: False
$XONSH_INTERACTIVE¶
True
if xonsh is running interactively, and False
otherwise.
configurable: False
default: ‘<default not set>’
store_as_str: False
$XONSH_LOGIN¶
True
if xonsh is running as a login shell, and False
otherwise.
configurable: False
default: False
store_as_str: False
$XONSH_PROC_FREQUENCY¶
The process frequency is the time that xonsh process threads sleep for while running command pipelines. The value has units of seconds [s].
configurable: True
default: 0.0001
store_as_str: False
$XONSH_SHOW_TRACEBACK¶
Controls if a traceback is shown if exceptions occur in the shell. Set to True
to always show traceback or False
to always hide. If undefined then the traceback is hidden but a notice is shown on how to enable the full traceback.
configurable: True
default: False
store_as_str: False
$XONSH_SOURCE¶
When running a xonsh script, this variable contains the absolute path to the currently executing script’s file.
configurable: False
default: ‘<default not set>’
store_as_str: False
$XONSH_STDERR_POSTFIX¶
A format string, using the same keys and colors as $PROMPT
, that is appended whenever stderr is displayed. This may be used in conjunction with $XONSH_STDERR_PREFIX
to start the block.For example, to have stderr appear on a red background, the prefix & postfix pair would be “{BACKGROUND_RED}” & “{NO_COLOR}”.
configurable: True
default: ‘’
store_as_str: False
$XONSH_STDERR_PREFIX¶
A format string, using the same keys and colors as $PROMPT
, that is prepended whenever stderr is displayed. This may be used in conjunction with $XONSH_STDERR_POSTFIX
to close out the block.For example, to have stderr appear on a red background, the prefix & postfix pair would be “{BACKGROUND_RED}” & “{NO_COLOR}”.
configurable: True
default: ‘’
store_as_str: False
$ XONSH_STORE_STDOUT ¶
履歴ファイルにストリームstdout
とstderr
ストリームを保存するかどうか。
設定可能: True
デフォルト: False
store_as_str: False
$ XONSH_TRACEBACK_LOGFILE ¶
XONSH_SHOW_TRACEBACK
設定されているかどうかにかかわらず、トレースバックログを保存するファイルを指定します。トレースバックのロギングが望ましくない場合、その値は書き込み可能なファイルでなければなりません。ファイルへのロギングはデフォルトでは有効になっていません。
設定可能: True
デフォルト:なし
store_as_str: False