Commit graph

2283 commits

Author SHA1 Message Date
Łukasz Langa
1183813ff7
Fix ignored exception in tracer shutdown related to module deletion (#5806)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
With the tracer on, modules at shutdown can be destroyed in an order
that prevents the `trace()` function from working. This was currently
the case with Python 3.13 where the function was still being called
during the `xonsh.tracer` module's destruction.

This change adds a test to prevent this from happening in the future,
and works around the issue by creating local references to necessary
functions that were otherwise set to None at shutdown.
2025-03-03 18:07:18 +06:00
Jason R. Coombs
34b3f3cfbe
Get cmd.exe from a well-known location. (#5779)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-26 13:23:22 -05:00
Łukasz Langa
c1e9186fe3
Fix SQL injection in history delete on the sqlite backend (#5799)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
* Fix SQL injection in history delete on the sqlite backend

Also, return a value from history delete on the sqlite backend. Otherwise the
command always responded with "Deleted None entries from history".

Also, use XH_SQLITE_TABLE_NAME consistently across xonsh.history.sqlite.
Before, most of the calls used the variable, but part of them hard-coded the
table name.

* Add news entry

* Fix ReST syntax in changelog entry
2025-02-26 00:54:59 +06:00
Andy Kipp
71d4920ac5
Update pipelines.py: fix checking self.proc (#5794)
Some checks failed
Build and deploy docs / Xonsh docs to gh-pages (push) Has been cancelled
CI Tests / Test Python 3.10 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.11 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.12 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.13 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.10 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.11 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.12 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.13 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.10 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.11 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.12 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.13 windows-latest (push) Has been cancelled
* Update pipelines.py

* Create pipelines_fix_check_self_proc.rst
2025-02-14 22:09:10 +05:30
Gil Forsyth
5dde2304e9 Updated CHANGELOG for 0.19.2 2025-02-11 12:08:13 -05:00
Łukasz Langa
43f62750ac
Don't append a space if the single available completion ends with a directory separator (#5792)
* Don't append a space if the single available completion ends with a directory separator

* Update subprocess-completions-dir-spaces.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-11 11:16:43 +06:00
jfmontanaro
a33ccdf636
Implement history pull for JSON history backend (#5788)
* add --session-id option to `history pull` command

* implement `history pull` for JSON history

* add news item for `history pull` updates

* add documentation for history pull `--session-id` option

* add explanatory comment for sleep in test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update json-history-pull.rst

* fix failing tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-03 22:34:19 +06:00
jfmontanaro
77ecefff34
Fix PTK shell sometimes not updating auto-suggest when up-arrow is pressed (#5787)
* fix combining consecutive history entries when loading ptk shell

* add test case for combining history items

* add news item for PTK history combining

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update ptk-history-combining.rst

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-31 21:40:43 +06:00
jfmontanaro
2cdcd6c976
Forward SIGHUP to child processes and process SystemExit more carefully (#5786)
* propagate SIGHUP to child processes

* do not wait for active job if shell is exiting

* move on_postcommand event out of _append_history and document behavior

* add changelog

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update built_ins.py

* Update hup-propagation.rst

* use sys.exc_info instead of sys.exception for version compatibility

* update test_default_append_history to work with new history/postcommand interaction

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add tests for SIGHUP forwarding and postcommand blocking

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix linting errors in news entry

* use tmpdir fixture in sighup tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_integrations.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-30 17:06:50 +06:00
Artur Manuel
0292b43e64
feat(environ): allow XONSH_*_DIR to be configurable (#5783)
* feat(environ): allow XONSH_*_DIR to be configurable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test(env): add env var test

* fix(test): move test to test_environ

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update test_environ.py

* Update configurable-xonsh-dirs.rst

---------

Co-authored-by: Artur Manuel <balkenix@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-29 22:14:02 +06:00
Đỗ Trung Nguyên
e7426ce709
Add configuring cursor shape for prompt toolkit (#5785)
* env: add `PROMPT_TOOLKIT_CURSOR_SHAPE` for configuring `prompt_toolkit` cursor shape

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* accepting prompt_toolkit.cursor_shapes.CursorShape as value

* rename PROMPT_TOOLKIT_CURSOR_SHAPE => XONSH_PROMPT_CURSOR_SHAPE

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-27 14:56:19 +06:00
Gil Forsyth
ad4ec32307 Updated CHANGELOG for 0.19.1 2025-01-13 11:54:31 -05:00
Andy Kipp
5be43ba7a8
Fixed hanging the command right after calling full capture subprocess (#5769)
* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* test

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

---------

Co-authored-by: Andy Kipp <no@no.no>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <123@321.123>
2025-01-13 12:27:29 +06:00
Evgeny
4c0b223e7b
Allow non-integer exit codes (#5721)
* Allow non-integer exit codes justl like in Python proper

* doc: add news item

* Update fr-exit-str.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-12-10 12:26:12 +06:00
Gil Forsyth
c059ac23d2 Updated CHANGELOG for 0.19.0 2024-12-09 09:41:03 -05:00
Simon Billinge
1d1e7a8827
try just using CaseSenssitiveDict from requests to see if it works (#5744)
* try just using CaseSenssitiveDict from requests to see if it works

* put the dependency back in pyproject.toml and ignore typing on import

* news

* code now passing tests locally.  I still need to write tests for the new Class

* tests for CaseInsensitiveDict
2024-12-08 13:58:31 +05:30
Bala
0791372f30
Fix DeprecationWarning while initializing Expression (#5739)
* Fix DeprecationWarning while initializing `Expression`

* Add news item

* Rename the news file to the branch name

* Fixing more ast related warnings
2024-12-02 17:31:09 +05:30
Jueun Lee
599f1c0f36
env: add XONSH_SUPPRESS_WELCOME to suppress welcome msg (#5719)
add `XONSH_SUPPRESS_WELCOME` variable to suppress welcome msg

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-11-18 18:04:24 -05:00
DoronZ
6fefc3c68d parsers: fix deprecation warnings triggered on python3.13
Close #5710
2024-11-17 08:44:39 -05:00
Gil Forsyth
cd05822f9a Updated CHANGELOG for 0.18.4 2024-11-02 17:46:42 -04:00
Peter Ye
79b3561c21
Catch SystemExit in ProcProxy (#5698)
* catch SystemExit in ProcProxy

* add test

* add news

* update test

* Update fix-procproxy-sys-exit.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-10-03 22:04:09 +05:30
Peter Ye
4fc7d59c95
Fix quoting issue in virtualenv activator (#5700)
* add test case for directory with spaces

* Stop XonshActivator from quoting strings

* add news

* Update fix-virtualenv-quoting.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-10-03 14:49:05 +02:00
Gil Forsyth
27ab7f1331 Updated CHANGELOG for 0.18.3 2024-08-20 09:11:18 -04:00
Andy Kipp
938db85a87
Partial fix: Callable alias can provoke Bad file descriptor exception in the internal or external code (#5645)
* fix

* fix

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* news

* test

* test

* test

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* news

* bump test

* bump test

* test

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* news

* test

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-09 14:46:19 +02:00
Andy Kipp
a1846d0579
Fix safe readlines: AttributeError: 'NoneType' object has no attribute 'readlines' (#5646)
* fix

* news

* fix

---------

Co-authored-by: a <1@1.1>
2024-08-08 14:26:33 +02:00
Andy Kipp
1c792bc884
MULTILINE_PROMPT: using space without background (#5634)
* Update environ.py

* Update multiline_prompt.rst

* Update multiline_prompt.rst

* chore: configure codcov action

---------

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2024-08-04 06:39:01 +05:30
Aidan Courtney
58e2856145
Fix: exception when completing in python-only context (#5632)
* Fix: change xonsh/completer.py:Completer.complete_with_context and xonsh/completer.py:Completer.complete_line to use the python context prefix if available. Add simple regression test: tests/test_completer.py:test_python_only_context

* Add news item

* Fix: misspelled 'command'

* Update fix_python_only_completion.rst

* Update fix_python_only_completion.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-07-27 21:03:35 +05:30
Andy Kipp
32d72af53d
MULTILINE_PROMPT: using space with background (#5624)
* Update environ.py

* news

---------

Co-authored-by: a <1@1.1>
2024-07-25 12:11:12 +02:00
Andy Kipp
680dcf06ff
executables: Added `locate_relative_path functionality to locate_file`. (#5630)
* locate_relative_path

* test

* news

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* test

* support pathext

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* test

* sep

* prefix

* fix pyghook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix pyghook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-25 12:56:30 +05:30
Andy Kipp
31e7c4204a
Fixed `$AUTO_CD` regress after previous refactoring. (#5629)
* fix autocd

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-24 19:00:53 +02:00
Gil Forsyth
5d1f769e88 Updated CHANGELOG for 0.18.2 2024-07-18 09:23:44 -04:00
Andy Kipp
2414ec167a
fix locate_file (#5606)
* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-18 10:53:00 +02:00
Gil Forsyth
75943cc7c3 Updated CHANGELOG for 0.18.0 2024-07-17 10:23:17 -04:00
Andy Kipp
01f0f6cd5f
env: added XONSH_MODE (#5581)
* added XONSH_MODE

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xonsh/environ.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-07-16 12:06:37 -04:00
Andy Kipp
5e1c2db4f3
Update news/spec_modifier_multiple.rst 2024-07-15 16:29:54 +02:00
Andy Kipp
38d3bfb41e
Update news/spec_modifier_multiple.rst 2024-07-15 16:29:30 +02:00
Andy Kipp
233e407b52
spec modifier: rename to decorator alias (#5579)
* rename

* rename

* rename

* rename

* rename

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename

* rename

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* rename

* rename

* rename

* rename

* rename

* rename

* rename

* rename

* rename

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* fix

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-14 22:00:24 +02:00
Andy Kipp
96c2c0af14
tutorial: added example for callable environment variable (#5585)
* doc

* doc

---------

Co-authored-by: a <1@1.1>
2024-07-14 21:04:24 +02:00
Andy Kipp
77f42b2f85
builtin: `exit can return exit code e.g. exit 71` (#5594)
* exit

* news

* switch bool to int

* event

* tests

* tests

* tests

* tests

* bump tests

* tests

* tests

* support unknown arg in exit

* docstring

---------

Co-authored-by: a <1@1.1>
2024-07-14 16:13:06 +02:00
Andy Kipp
d08248f6aa
builtin: added `__xonsh__.imp` to have an ability to import and use modules immediately in one line (#5595)
* imp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* imp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* imp

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-12 02:21:21 +02:00
Andy Kipp
87032f6d30
Alias that returns modified command (#5473)
* Command Alias

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* news

* docs

* tests

* docs

* wip

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tests

* tests

* clean

* news

* news

* bumptests

* bumptests

* new api

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* doooocs

* comments

* comments

* comments

* aliases.CUT_ARGS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* aliases.CUT_ARGS

* aliases.CUT_ARGS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* aliases.CUT_ARGS

* aliases.CUT_ARGS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* aliases.CUT_ARGS

* comments

* bump test

* remove CUT_ARGS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

* test

* wip

* revert

* wip

* wip

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* wip

* docs

* news

* tests

* tests

* test

* test

* test

* Update docs/tutorial.rst

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Update xonsh/aliases.py

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix, thanks jaraco!

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* more comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* cleaning

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-07-12 01:35:20 +02:00
Andy Kipp
645c335fc6
builtins: add color to printx (#5588)
* color

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update xonsh/tools.py

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-07-11 13:29:35 +02:00
Andy Kipp
2142a7b85e
tools: added `mkdir to xonsh.tools.chdir` (#5589)
* mkdir chdir

* mkdir chdir

* mkdir chdir

* mkdir chdir

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-10 22:49:57 +02:00
a
7085a94fca Revert "color"
This reverts commit 729f55238e.
2024-07-10 14:03:54 +02:00
a
729f55238e color 2024-07-10 14:02:58 +02:00
Andy Kipp
86d3f9427e
xontrib: do not autoload xontribs in `xonsh --no-rc` mode (#5586)
* no rc no autoload

* docs

---------

Co-authored-by: a <1@1.1>
2024-07-09 17:21:20 +02:00
Andy Kipp
059fc301e7
Introduce new resolver for executables to replace commands_cache usages and speed up everything (#5544)
* remove commands_cache from pyghooks to avoid cc.update_cache on every key press

* create executables.py

* replace cc.locate_binary to locate_executable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* vc: replace locate_binary

* pyghooks: remove commands_cache

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unused func _yield_executables

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Move `executables_in` from tools to commands_cache to avoid circular imports.

* First steps to `procs.executables` that is based on `commands_cache` and `tools`.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test_executables

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add not recommended notes

* tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add `get_paths` with test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix source test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* vc: remove tests because commands cache is not used

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* specs: fix exception for recursive call

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* specs: fix exception for recursive call

* improve test_locate_executable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix test

* beautify pathext

* tests

* docs

* tests

* update locators

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* locate_file

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* comments

* return environ locate bin test

* comments

* Update xonsh/procs/executables.py

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Update xonsh/procs/executables.py

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Update xonsh/procs/executables.py

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add itertools

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* moving is_executable

* doc

* optimization is_executable_in_windows

* micro improvements

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* news

* news

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* bump test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-07-09 09:44:03 +02:00
Andy Kipp
6fd8937ee5
aliases: Added ability to set multiple spec modifiers (#5574)
* wip

* test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-04 16:10:02 +02:00
Niraj Kulkarni
4e06328bec
Rewrited deprecated in print_exception (#5407)
* Change deprecated sys variable assignment in print_exception

* Add changelog in news/print_exception_fix.rst
2024-07-04 10:37:55 +02:00
Andy Kipp
61a77ac3ce
Callable alias: fixed capturing stdout in case of redirect (#5527)
### Motivation

Closes #5512. 
The issue was introduced in #4445. It's needed to add checking the
redirect case.

### Before

```xsh
cd /tmp
@aliases.register('a')
def _a():
    print("1-hello")
    echo 2-hello
a > o.txt
# 2-hello
cat o.txt
# 1-hello
```

### After

```xsh
cd /tmp
@aliases.register('a')
def _a():
    print("1-hello")
    echo 2-hello
a > o.txt
cat o.txt
# 1-hello
# 2-hello
```

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-07-02 09:30:06 +02:00