* Update terminal title before executing subprocess
This eliminates the need to use `pause_call_resume()`, which causes issues
when it sends SIGSTOP to a process that is in the middle of a syscall
(for example, the `swaymsg` command fails when it gets stopped during
a `recv` syscall).
Additionally, this approach is more flexible, as it allows captured
commands and callable aliases to also be updated as expected in the
terminal's title.
* Clear prompt cache in readline shell
* Add type annotation
* Use reset_key() to only reset current_job
* Convert into PromptField class
* Support PromptField with value of None
Allows {current_job:{} | } to work as expected when current_job is a
PromptField.
* Add tests
* Fixing bash completion bug when prefix started with '>', '<', or ':'
* Fixing code formatting
* More code formatting fixes
* Fixing test
* Refactor to fix bug by improving completion parser
* Supporting '<' and '>>' in completion parser
* Support for all IO redirect tokens
* Make job control task queue thread-local
This allows callable aliases to maintain a separate task queue from the
main thread.
* Make job control dictionary thread-local
Use XSH.all_jobs for the main thread and a separate dictionary for other
threads. This allows callable aliases to keep track of their jobs
separate from the main thread.
* Implement use_main_jobs() context manager
This allows threaded commands like jobs, disown, and bg to handle the
main thread's job control
* Run commands in the same process group if in a thread
* Fix tests that use jobs and tasks
* Add tests for subprocess call inside alias
* Add news
* Remove type declarations for _jobs_thread_local
Fixes the mypy error: "Type cannot be declared in assignment to non-self attribute"
Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
The fallback is already the default behavior if the user has `pygments`
installed, but if they don't we were awkwardly bailing out here and
preventing startup.
* 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