Commit graph

2173 commits

Author SHA1 Message Date
Andy Kipp
2419eaa952
Fix jobs.py: list index out of range (#5340)
* Update jobs.py

* Create fix-jobs-index.rst

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

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

* Update fix-jobs-index.rst

* Update test_virtualenv_activator.py

* Update test_virtualenv_activator.py

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

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

* Update test_virtualenv_activator.py

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

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

* test: update venv activator test

* chore: update test xonsh

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2024-04-19 10:33:30 +02:00
Gil Forsyth
fde07cda5f
refactor(aliases): source foreign shell funcs without interactive mode (#5344)
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>
2024-04-18 19:51:39 +05:30
Andy Kipp
6c94d4ad6c
Builtin aliases (xontrib, history) switched to threadable mode (#5321)
* Create xonfig_xontrib_threadable.rst

* xonfig and xontrib threadable

* xonfig and xontrib threadable

* xonfig and xontrib threadable

* Update builtin_aliases_threadable.rst

* Update xonfig.py

---------

Co-authored-by: a <1@1.1>
2024-04-16 13:27:55 -04:00
Noortheen Raja
2a6e5e15f8 docs: update contribution guide 2024-04-16 11:23:35 -04:00
Noortheen Raja
912c7d395c refactor!: remove deprecated module xonsh.proc 2024-04-16 11:23:35 -04:00
Andy Kipp
db83a3f353
Bump xonsh.AppImage to python 3.12 (#5338)
* Update rever.xsh

* Create appimage-py312.rst

* Update appimage-py312.rst
2024-04-16 11:37:20 +02:00
Peter Ye
a7688f647d
fix: do not attempt to color traceback for error in xonshrc file (#5331)
do not color traceback unless shell has been loaded
2024-04-11 08:22:08 +05:30
l-no
a028c72deb
fix: Error in completions with absolute paths (#5127) (#5328)
fix: Error in completions with absolute paths

fixes #5127, an error in fetching command completions when
UPDATE_COMPLETIONS_ON_KEYPRESS is enabled and the command is specified
by absolute path.
2024-04-10 11:18:46 +05:30
Peter Ye
5a525e3789
feat: allow square brackets in command arguments (#5326)
Allow square brackets in command arguments
2024-04-09 22:33:43 +05:30
Peter Ye
08ac0d9759
Fix parsing of redirect tokens (#5322)
* Fix parsing of redirect tokens

In the parser, wrap redirect tokens such as ">", "a>", and "2>1" in a
tuple (along with the name of the redirect file, if applicable) to
differentiate them from regular command line arguments.

This ensures that a command like ![echo ">"] is parsed correctly.

We now need 2 types of IO-redirect tokens (IOREDIRECT1 and IOREDIRECT2)
so that the parser knows whether or not an IO-redirect has a file
argument. For example, "a>" has type IOREDIRECT1, whereas "2>1" has
type IOREDIRECT2.

* update ioredir tests

* add tests

* add news

* fix multiple redirections error message
2024-04-05 13:21:54 +05:30
Peter Ye
7461c507b2
Fix incorrect IOREDIRECT tokens in Python mode (#5013)
* add tests

* Fix incorrect IOREDIRECT tokens in Python mode

* add news

* Update lexer used in CompletionContextParser

The completion context lexer should start in subprocess mode so that
operators like ``2>`` are recognized as IOREDIRECT tokens.

This fixes the test case "command 2>/dev/nul{X}" for
test_completion_context.py::test_command.
2024-04-04 16:04:53 +05:30
Noortheen Raja
c930c9f234 fix: web config overwrite existing value
fixes #5297
2024-03-19 16:33:12 +05:30
Noortheen Raja
ce215bb8fe docs: add news item 2024-03-19 16:33:12 +05:30
Andy Kipp
5fd9a25d09
Fix dircolors NotADirectoryError (#5300)
* Update environ.py

* Create fix_dircolors_NotADirectoryError.rst
2024-03-11 16:53:50 -04:00
Gil Forsyth
f5ae75268a
feat(bashpath): add env-var to allow overriding path to bash (#5295)
I've run into issues with bash completion failing when using `nix` to
handle environments.
The nix environment often installs its own `bash` which doesn't respect
the `BASH_COMPLETIONS` env-var.

This allows an (off-by-default) option to override what is returned by
`xonsh.platform.bash_command`.

The removal of the `lru_cache` should be negligible since
`windows_bash_command` has its own `lru_cache` and the other options are
doing an env lookup or returning a string.
2024-03-08 17:57:53 +01:00
Gil Forsyth
43c9aafe61 Updated CHANGELOG for 0.15.1 2024-03-07 10:11:43 -05:00
doronz88
cb85c938b3
pytest: Fix pytest collection starting at pytest>=8.1.0 (#5293) 2024-03-05 23:51:01 +01:00
Daniel Saunders
d4a342f49d
Fix documented default loc parameter for add_one_completer() (#5289)
* Correct documentation about default parameter

* Create DanielSaunders-patch-1.rst
2024-02-27 16:22:12 +01:00
Gil Forsyth
1da7118e23 Updated CHANGELOG for 0.15.0 2024-02-24 19:09:24 -05:00
Andy Kipp
7a915113f6
Pin prompt-toolkit version (#5288)
* Update pyproject.toml

* Create pin-ptk.rst

* chore: strip whitespace

---------

Co-authored-by: Gil Forsyth <gil@forsyth.dev>
2024-02-24 18:42:50 -05:00
Jason R. Coombs
1d54c74832
Mention VS Code supports xonsh as default shell (#5273)
* Add paragraph about support for xonsh as the default shell.

Ref #4469

Also, updated the text to use 'VS Code', which is the preferred short name.

* Add news entry.
2024-02-06 00:29:45 +01:00
Matthieu LAURENT
7c23508afc
Add news item about Atuin support (#5272) 2024-01-30 12:24:36 +01:00
Gil Forsyth
0f16fa7d64 Updated CHANGELOG for 0.14.4 2024-01-16 08:58:06 -05:00
Nathan Monfils
5b20891975
Actually fully disable system clipboard (#5155) (#5261)
Allow to fully disable system clipboard

Fixes #5155

In VI mode, disabling "delete" hotkeys isn't enough.

After discussion in #5261, we don't change the default behavior but
allow fully disabling the system clipboard to better support the
use-case of VI mode user.

Co-authored-by: Nathan Monfils <nmo@escaux.com>
2024-01-15 15:55:23 +05:30
Gil Forsyth
23c50c215e Updated CHANGELOG for 0.14.3 2023-12-05 10:47:54 -05:00
Gil Forsyth
7a5d7c2886
fix(xpip): patch in user site packages for xpip where needed (#5238) 2023-12-05 10:46:49 -05:00
Joshix-1
b2b23a8240
add generic on_pre_spec_run and on_post_spec_run (#5232)
* add generic on_pre_spec_run and on_post_spec_run

* black

* edit docs/events.rst

* news

* Update on_pre_spec_run-on_post_spec_run.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2023-11-23 12:19:34 +01:00
Gil Forsyth
0b141e56ad Updated CHANGELOG for 0.14.2 2023-11-17 10:58:12 -05:00
doronz88
f308813f15
history: fix json file permissions upon sudo (#5220) (#5221) 2023-10-25 16:26:04 -04:00
Gil Forsyth
0fe0a6c03e
fix(dirstack): use XSH.env for $HOME check, not os.path (#5211)
`os.path.expanduser` relies on the value of `$HOME` set in `os.environ`.
This meant that a user who set `$HOME` would then not end up in that
directory with a no-argument call to `cd` unless they had set
`UPDATE_OS_ENVIRON`.

Now the value of `$HOME` is respected regardless of the setting in `UPDATE_OS_ENVIRON`
2023-09-25 14:53:15 +06:00
ShalokShalom
60f0145ed8
Mention 3.6 instead of 3.5 in docs (#5193)
* Update intro.rst to mention Python 3.6

The homepage mentions 3.6, so I update this section to be in line

* Create upgrade-python-version.rst

Add news item for https://github.com/xonsh/xonsh/pull/5193
2023-08-23 21:30:20 +06:00
Wilfried Pollan
b3c3e60a05
Fix/parse multiline foreign shell aliases (#5191)
* fix: Correctly multi line aliases

Bash aliases can span multi lines for readablity or if they are to long
for one line.

Here we just remove added the backslash before further processing.

* doc: Add news item for fix/parse-multiline-aliases branch

---------

Co-authored-by: Wilfried Pollan <wilfried.pollan@moqodow.com>
2023-08-23 00:47:47 +06:00
Gil Forsyth
16c91b71cc Updated CHANGELOG for 0.14.1 2023-08-16 03:01:35 -04:00
HackTheOxidation
44b661dcc0
Add history delete #4929 (#5172)
* Add `history delete` #4929

* Add news and satisfy linter.

* Added `history delete` for sqlite backend

* Format with black.

* Use REGEXP instead of LIKE for sqlite backend.

* History delete: iterate over entries for sqlite backend.

* Use '='-operator instead of LIKE.
2023-08-14 22:42:26 +05:30
Cosine Chen
0e229fcc8c
Always load rc files except --no-rc is passed (#5099) 2023-07-26 22:44:55 +00:00
Ivan Ogasawara
de74576464
fix: Fix wrong verification for the simple output, introduced by PR5072 (#5174)
* fix: Fix wrong verification for the simple output, introduced by PR5072

* add a news
2023-07-16 21:30:12 +05:30
Noorhteen Raja NJ
769dfbe6aa
Py 312 pre-liminary support (#5156)
* refactor: project requires 3.9+

changed as per NEP-29
https://numpy.org/neps/nep-0029-deprecation_policy.html

* test: nose type tests are deprecated in pytest now

* fix: deprecation of ast.Str and ast.Bytes and .s attribute access

* fix: deprecation of ast.Num,ast.NameConstant,ast.Ellipsis

* refactor: upgrade code to be py39+ using ruff

the changes are auto-generated

* refactor: remove typing.Annotated compatibility code

* fix: temporarily disable having xonsh syntax inside f-strings

* test: skip failing tests

there is no workaround for this version. It might get solved in the
final release though

* refactor: make XonshSession.completer lazily populated

this speedsup the tests as cmd_cache would not be actively populated
when used in default_completers function

* refactor: make presence of walrus operator default
2023-07-04 22:18:37 +05:30
Andy Kipp
041bfb2d29
Become a sponsor to xonsh (#5167) 2023-07-01 13:15:06 +00:00
Evgeny
f303f0f395
Unset the default Semantic Prompt line continuation environment variables (#5160)
* unset default multiline prompt pre/pos env vars

Allows xontribs to differentiate between an explicit user setting of an empty prefix vs. an unset value

* doc: add News item
2023-06-30 09:57:29 +05:30
doronz88
2ff39e8e04
platform: fix BASH_COMPLETIONS_DEFAULT on M1 (#5165) 2023-06-29 20:53:13 +06:00
Gil Forsyth
0fb889a7cf Updated CHANGELOG for 0.14.0 2023-05-19 09:30:52 -04:00
Andy Kipp
e1a93cef19
New prompt end character (#5063)
Co-authored-by: a <1@1.1>
2023-05-16 13:36:50 +00:00
Evgeny
572331700b
fix: load autoloading (but not yet autoloaded) xontribs (#5096)
* fix: load autoloading (but not yet autoloaded) xontribs

Xontrib template creates autoloaded xontribs in a `xontrib_X` folder instad of a `xontib/X.py`file, so you can't 'xontrib load X' right after you install them, which breaks pytests

* [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>
2023-03-17 18:57:03 +05:30
Andy Kipp
042487745a
Moving old xontribs to repositories (#5055)
* Update and rename README to README.rst

* Create hello_world.py

* Update README.rst

* init

* remove bashisms

* Transfer abbrevs to xontrib-abbrevs

* Transfer free-cwd to xontrib-free-cwd

* news

* black

* Transfer fish-completer to xonsh/xontrib-fish-completer

* Transfer vox to xonsh/xontrib-vox

* Transfer pdb, xog to xonsh/xontrib-debug-tools

* remove hello_world

* fix tests

* black

* fix whitespaces

* fix readme

* Update python_virtual_environments.rst

* Update README.rst

* Update xontribs_transfer.rst

---------

Co-authored-by: a <1@1.1>
2023-03-17 13:25:22 +06:00
Ivan Ogasawara
2a63f1f875
Improve error message for RAISE_SUBPROC_ERROR=True (#5072)
* Improve error message for RAISE_SUBPROC_ERROR=True

* Fix tests

* Add colors to the short output

* Move the colored code to a function

* Fix output
2023-03-05 07:49:42 +05:30
Andy Kipp
4c5c88a72f
Update index.html (#5078)
* Update index.html

* Create xonsh_landing.rst

* remove the quarter msg

---------

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2023-03-03 00:15:36 +06:00
Andy Kipp
71ac21f241
Fix missing webconfig/js/xonsh_sticker.svg (#5077)
* Update pyproject.toml

* Create fix_missing_icon.rst
2023-03-02 15:01:50 +05:30
Thomas Hess
cb95f0e487
Add support for Fossil SCM branch names in vc.py. (#5046)
Add support for Fossil VCS in vc.py.

The prompt now shows the currently active Fossil branch, while inside a Fossil checkout.
2023-03-02 12:35:22 +05:30
Andy Kipp
237e231e7f
Moving chdir to xonsh.tools (#5073)
* 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>
2023-03-02 12:31:08 +05:30
Andy Kipp
ec378090ce
Using repr(cmd) for command not found (#5075)
repr cmd

Co-authored-by: a <1@1.1>
2023-03-02 11:13:36 +05:30