* feat: add support for f-glob strings
Move xonsh_pathsearch() into the BaseParser class because it needs to use self._set_error()
Parametrize 6 backtick tests in test_parser.py into test_backtick() (and add cases for f-glob strings)
* add news
* docs: update tutorial
* fix news file
* Change ![] to return an object for background command
* Fix `fg` for commands started in the background
Fixes#4595
This issue was caused by `CommandPipeline.term_pgid` not being set for commands started in the background.
This binds Alt/Control+Delete/Backspace to support deletion matching
the motion bindings in `whole_word_jumping`.
Should work mostly out of the box on terminals that generate `\x7f`
when `backspace` is pressed and `\x08` when `control+backspace` is
pressed. Tested to work on Microsoft Terminal (WSL2). For
incompatible terminals, users can set `$XONSH_WHOLE_WORD_CTRL_BKSP
= False` to avoid configuration of the `control+backspace` binding.
* feat: add function to make event registration from function signature
* docs: add xontrib special functions description
* feat: handle xontribs with special functions
also reduce usage of XSH singleton
* fix: missing XSH
for now import singleton
* docs: fix .rst format
* fix: failing tests
* feat: implement primitive xontrib-unload and xontrib-reload
* chore: give explicit name
* docs: update doc
* add test for importing empty .xsh file
* test: empty lines do not get appended to history
prompt-toolkit needs its own test outside of test_base_shell.py because it uses a custom _push() method
* fix: do not append empty/comment-only input to history
Adds a compile_empty_tree argument to Execer.compile()
By default, the argument is `True`, and `compile()` returns a compiled `pass` statement for comment-only input.
When the argument is `False`, `compile()` returns `None` for comment-only input.
The base shell and prompt-toolkit shell use `compile_empty_tree = False` so that they get `None` as the compiled code and don't append the command to the history.
* add news
* fix tests
* Fix tab-completion trailing space for command arguments that use equals sign
* Add test for completion of path ending with equal sign
* Move test_path_completers.py to tests/completers
* Restore _quote_paths() to original behaviour
* Apply trailing equal sign fix to _bash_quote_paths()
Use _bash_quote_paths instead of _quote_paths in complete_from_bash()
* Do not need to pass quote_paths=_bash_quote_paths
We shouldn't fail to start if the available PTK version doesn't support
modal cursor stuff.
(We should probably also make modal cursor stuff optional, but that can
happen later)
* Fix regex globbing for paths that contain special regex characters
* Skip regex globbing asterisk character tests on Windows
Asterisks are forbidden in Windows filenames. Plus signs are allowed in Windows filenames, so the plus sign tests run properly.
* Added reference to ``PROMPT_FIELDS`` section in ``time_format`` definition
* Forgot the news item, added now
* Generalized reference to PROMPT_FIELDS
* fix: ptk now support modal cursor shape, use it when vi_mode is enabled
* lint: use double-quotes
* bump ptk dependency in setup and integration
* lint: sorting imports
* feat: initial match statement support
* refactor assignment exprs for <3.8 compatibility; sort imports
* remove match extensions
* bump qa-workflow python version, minor alterations for qa-pipeline
* add mypy exception
* update mypy version
* Bump workflow main python version to 3.10
* remove outdated note
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
fixes#4670
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.
This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.
fixes#4670
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.
This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.
fixes#4670
* add type annotations
* always return str
This is more consistent and might also deal with a mypy error only observed on Ubuntu Linux python3.9
* remove unnecessary import
* adapt code to not break the documented API
When restructuring the code, I did not know that this was part of a documented API. This restores the API functions and updates the doc strings. New helper functions have been made private.
* feat: better stacktraces
* reraise SystemExit to enable proper exit codes and maintain old
behaviour in repl
* dont ignore exceptions when loading rc-files
* update tests with new SyntaxError formatting, new behavior that main
does not throw user exceptions
* pull return out of finally (flake8, B012)
* hide XonshError traces, fix mypy error, enable circumvention of trace suppression
with XONSH_DEBUG in non-interactive use
* fix mypy error
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
* Add xontrib-gruvbox to xontribs_meta.py
* Add news item for xontrib-gruvbox
Co-authored-by: Ryan Delaney <ryan.patrick.delaney+github@protonmail.com>
* fix: pip -r appends spaces at the end
modularize completing output from subproc-out
* docs:
* fix: flake8
* fix: failing pip comp tests
* refactor: naming xonsh conflicts with actual package
the IDE completions don't work.
we add this naming convention instead.
* feat: option to filter after completion returned
this will help reduce some boilerplate, and we can enrich the filtering
behaviour
* feat: add gh completions
* fix: filtering out completions
* refactor: simplify invoking completer interface
* test: add fixture for xsh with os-env
* test: add tests for gh-completions
* fix: flake error
* fix: mypy errors and update gh completer tests
* fix: handle cross-platform line endings
* feat: include man,bash completer only if available
* todo: improve man page completions
* fix: failing man page tests
* fix: py 3.7 compatibility
* fix: qa error
* fix: stop dir completions
* feat: improve man page completions
now shows descriptions, recognizes more number of options correctly
* fix: update man page completions
* feat: support filtering based on display as well
* Update xonsh/completer.py
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* style:
* test: xfail ptk-shell tests on windows
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>