This fixes most of the lint errors in the history code. It also fixes
two bugs that were found by pylint due to misnamed variables. This patch
does not make any functional changes. I'll fix the remaining lint errors
in a subsequent patch when I tackle cross-module issues.
This replaces the bash script I originally proposed as a way to safely invoke
unit tests with a xonsh script (we need to eat our own dog food). This also
udpates the documentation.
This adds the envvar `VI_MODE`, (default `False`). If it is set to `True`,
either in a `.xonshrc` or dynamically, then the prompt is switched to
`vi_mode`.
`vi_mode` defaults to an `--insert--` environment, then user can hit ESC
to enter command mode, etc...
This makefile makes it easier to run things like unit tests and pylint
against the code. Especially before doing a commit. It also helps ensure
unit tests are not affected by local config files (e.g., ~/.xonshrc).
h/t @jonathanslenders
When using the prompt_toolkit shell, user can press Ctrl-X Ctrl-E to
open the current line in $EDITOR.
Limitations -- it can only open the _current_ line, so if you are
already in a multiline prompt, you can't edit what is already entered in
lines above.
However, you can enter multiline commands in the editor and these are
correctly interpreted by xonsh (assuming correct syntax, etc)
Fix the handling of negative history indexes where a slice specification
is involved. Negative indexes not part of a slice specification worked by
accident because the argparse module (see section "16.4.4.3 Arguments
containing --") treats such values as positional arguments (which is a
misfeature of argparse in my opinion). I've also added unit tests for
"history show" to keep this from being broken in the future.
prompt_toolkit completion wasn't triggering for command arguments unless
the first letter was entered. now it shows all the options when the
user hits tab, which matches the readline functionality and also the
default behavior in bash, zsh, fish, etc...
relocated from base_shell.
Checks the following:
$AUTO_CD=True
cmd is a directory
cmd is not in $PATH
no other arguments
If so, it prepends 'cd' and reruns