Commit graph

3 commits

Author SHA1 Message Date
Peter Ye
86e4f004e3
Fix job control for callable aliases (#4901)
* 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>
2022-08-03 11:37:26 +05:30
Noortheen Raja
78091a22f3 style: isort imports
fix #4584
2022-01-31 11:16:51 -05:00
Noorhteen Raja NJ
6c22b84f80
Ap/disown (#4442)
* feat: use ArgParserAlias for disown command

* feat: add rich-completer

* docs: add news item

* fix: mypy error

* test: add disown completer tests
2021-08-28 19:38:05 +03:00