Commit graph

2150 commits

Author SHA1 Message Date
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
Ivan Ogasawara
0c713a0c31
fix: Suppress subprocess traceback in case XONSH_SHOW_TRACEBACK=False and $RAISE_SUBPROC_ERROR=True (#5066)
* fix: Add and extra condition for print traceback from subprocess

* add news

* Apply pre-commit hooks

* Fix initial implementation using sys.exit

* Update pr-5066.rst

* Remove sys.exit

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2023-02-28 00:37:45 +05:30
Evgeny
076ea2583f
Add Semantic Prompt support to multiline continuation lines (#5065)
* fix: match the main return type to avoid a style class concat type error

Error: can only concatenate str (not "_TokenType") to str in prompt_toolkit/formatted_text/base.py, line 94, in <listcomp>
    [(style + " " + item_style, *rest) for item_style, *rest in result]

* feat: support semantic prompt sequences for the multiline prompt

* Ignore .python-version

* doc: add News item

* doc: add description for the new multiline prompt env vars
2023-02-21 14:41:39 +05:30
doronz88
204bb99079
key_bindings: map escape-right as another word completer for macOS (#5056) (#5059) 2023-02-15 11:31:21 -05:00
Andy Kipp
ebb6abd200
history pull (#5047)
Co-authored-by: a <aaa@aaa.aaa>
Closes https://github.com/xonsh/xonsh/issues/5044
2023-02-08 08:20:01 -05:00
Andy Kipp
a73f49c584 Update xontrib_load_skip_missing.rst 2023-01-23 21:04:29 +05:30
Andy Kipp
9b7fdce034 Update xontrib_load_skip_missing.rst 2023-01-23 21:04:29 +05:30
Andy Kipp
c248663fd7 Update xontrib_load_skip_missing.rst 2023-01-23 21:04:29 +05:30
Andy Kipp
8fc4cb0d72 Delete xontrib_load_skip_missing.srt 2023-01-23 21:04:29 +05:30
Andy Kipp
30416dd42a Create xontrib_load_skip_missing.rst 2023-01-23 21:04:29 +05:30
Andy Kipp
e2d9a7eb48 Create xontrib_load_skip_missing.srt 2023-01-23 21:04:29 +05:30
Andy Kipp
81e3bdd207
Bump APPIMAGE_PYTHON_VERSION to 3.11 and fix xpip for AppImage (#5024) 2023-01-12 09:22:34 -05:00
Mark Bestley
1e6faa47ce
Remove python REPL prompts so that you can copy the code (#5022) 2023-01-11 17:27:44 -05:00
Gil Forsyth
a587e7ec8c
chore: add 3.11 to wheel release action (#5009) 2022-12-11 14:14:50 +05:30
Gil Forsyth
ebadfac8d9 Updated CHANGELOG for 0.13.4 2022-12-08 09:37:21 -05:00
yotamolenik
e6932747f9
commands_cache: ignore mtime check on non-darwin os (#4988)
* environ: add a configurable value to disable cache

* docs: update env variable doc

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2022-12-05 21:04:20 +05:30
Qyriad
c07155dbe2
cmd cache: check possibilities when checking if alias overrides (#4996)
* cmd cache: check possibilities when checking if alias overrides

This fixes an issue on Windows where an alias could not override a
command without specifying the path extension.

* [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>
2022-11-23 23:15:19 +05:30
Noorhteen Raja NJ
c63f75efd0
cmd cache refactor - optimize cache usage (#4954)
* todo:

* refactor: remove usage of singleton in cmd-cache

* refactor: pass aliases/env to commands_cache on creation

reduce the usage of singletons

* fix: setting up mockups for tests

* feat: add $XONSH_CACHE_DIR

* refactor: use cache path to stire cmds-cache

* chore: todo

* feat: efficient cache commands per path and modified time

* refactor: move aliases to commands cache

now XonshSession is not needed to setup cmds-cache

* refactor: update tests

* fix: type annotation

* refactor: init aliases at commands-cache

* test: update failing tests

* fix: handle paths mtime changing

* docs: add news item

* refactor: remove $COMMANDS_CACHE_SIZE_WARNING

* fix: loading on windows fails because of setup sequence

* fix: failing tests
2022-11-14 23:52:10 +05:30
austin-yang
ed11f319fa
Fix: Allows user to assign #XONSH_STYLE_OVERRIDES a {Token:str} dictionary #4375 (#4973)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-24 10:46:52 -04:00
Vasilis Gerakaris
9c1a751fee
Fix auto-suggestion completion stacking if no normal completion exists (#4970)
* Fix auto-suggestion completion stacking if no normal completion exists

* Add tests for auto-suggest completions
2022-10-21 00:48:31 +05:30
Blake Ramsdell
b0c81048af
feat: add on_command_not_found event (#4959) 2022-10-11 08:54:12 -04:00
Blake Ramsdell
b5c42d6716
Add XONSH_HISTORY_IGNORE_REGEX support (#4953)
* Add XONSH_HISTORY_IGNORE_REGEX support

* Add changelog text

* Add cleanup notes for XONSH_HISTORY_IGNORE_REGEX

* Rename should_append to is_ignored

* Change is_ignored to a History method

* Remove unused re imports

* Docstring formatting cleanup, Black compliance

* Move XONSH_HISTORY_IGNORE_REGEX to History class

* Clarify with parenthesis

* Formatting compliance

* Add validate_ignore_regex check

* Remove validation comment

* Remove XONSH_HISTORY_IGNORE_REGEX test comments

* Add __init__ chaining to DummyHistory

* Add broken test for XONSH_IGNORE_REGEX

* Remove extra test variants

* Fix unit test environment variable name

* Add test for bad regex error output

* Remove unneeded __init__ chaining

* Add test_is_ignore

* Add is_regex and associated tests

* Add doc for XONSH_HISTORY_IGNORE_REGEX

* Change validate_ignore_regex to use is_regex

* Compile regex once and use a cached property

* Let cached_property handle saving regex
2022-10-05 00:16:42 +05:30
Lie Ryan
490f6f2636
#4951 Fix gitstatus prompt when rebasing (#4952)
* #4951 Fix gitstatus prompt when rebasing

* Create fix-gitstatus-rebase.rst
2022-09-28 14:07:51 +06:00
Gil Forsyth
0b8c105e5a Updated CHANGELOG for 0.13.3 2022-09-15 09:52:28 -04:00