Completions provided by prompt_toolkit are now configurable
by setting $COMPLETIONS_DISPLAY.
Changing it at runtime will take immediate effect, so you can quickly
disable and enable completions during shell sessions.
Possible values for $COMPLETIONS_DISPLAY are:
- 'none' for no completions,
- 'single' for single-column completions,
- 'multi' for multi-column completions (default).
Similar to bash and zsh behavior, this will allow the `source` command
to be used for files not in the current working directory that are
contained in $PATH.
Arch places the default bash_completion scriptlet in
/usr/share/bash-completion, not in /etc/bash_completion as in most *nix
systems.
This adds an extra flag to tools.py to check if the current OS is
Arch (according to `platform.linux_distribution`) and if it is, adjusts
the default location for bash_completion accordingly.
Introducing the new AUTO_SUGGEST environment variable for this,
which can either be True or False. Default is True.
In addition, make mouse_support a class variable of PromptToolkitShell
for consistency's sake.
Formatting:
One line was 100 characters long. Also swapped out \s for a set of
wrapping parentheses.
Execution order:
Since xonshrc_context loads the two environment files successively, I
swapped the order in which they're fed in so that the userspace xonshrc
will override any conflicts in the systemwide xonshrc
pypa/pip had a similar conversation about this a few years ago
(see: https://github.com/pypa/pip/issues/309) and determined that
placing global configuration files in `%ALLUSERSPROFILE%\Application
Data` was the best solution without messing around with the registry.
Following their lead on this, specifically from
pypa/pip@2b5029c5
Redefines the XONSHRC environment tuple to include the .xonshrc file in
user's home directory as well as a system-wide file that lives in
/etc/xonshrc (for Linux and OSX) and (TODO) somewhere else on Windows.
Then xonshrc_context does more or less what it always has, except now it
checks and places the contents of both files into the xonsh environment.