Commit graph

2136 commits

Author SHA1 Message Date
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
Gil Forsyth
7365ad1bc0
fix: do not prepend bg: to noinherit style directives (#4939)
Pygments does not understand a "background" of `noinherit`, only
`noinherit` -- so if we are setting `noinherit`, even for a background
color, we do not prepend `bg:`
2022-09-15 19:18:43 +05:30
Gil Forsyth
84405423df Updated CHANGELOG for 0.13.2 2022-09-15 08:47:38 -04:00
Andy Kipp
be69ff3ad0
Merge pull request #4836 from amukher3/main
Fix: timeit without arguments produces syntax error
2022-08-31 18:57:28 +06:00
Andy Kipp
3c997a004b
Update branch.rst 2022-08-31 18:43:09 +06:00
Andy Kipp
57a2dd185b
Update branch.rst 2022-08-31 18:31:02 +06:00
Andy Kipp
25cfcf16e6
Fix: xpip return None instead of command (#4922)
* Update aliases.py

* Create xpip.rst

* Update aliases.py

* Update aliases.py

* [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-08-18 20:19:43 +05:30
Peter Ye
588881803c
Make gitstatus prompt field values None when there is no git repo (#4920)
Make gitstatus prompt fields None when there is no git repo
2022-08-17 10:08:02 +05:30
Peter Ye
6fa83f8305
Do not capture unthreaded callable aliases run with ![] (#4919)
* Fix `cd` command error message when `$THREAD_SUBPROCS=False`

* also test $[]
2022-08-11 22:50:21 +05:30
Gil Forsyth
ffe7b3445c Updated CHANGELOG for 0.13.1 2022-08-10 09:46:22 -04:00
Peter Ye
08b302364a
Update terminal title before executing subprocess (#4916)
* 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
2022-08-10 09:50:09 +05:30
jbw3
f2ca59a291
Fixing bash completion bug when prefix started with '>', '<', or ':' (#4826)
* 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
2022-08-06 14:37:09 +05:30
Andy Kipp
aa03bc9013
Merge pull request #4909 from xonsh/anki-code-patch-3
Added ujson to xonsh[full] package
2022-08-04 21:35:48 +06:00
Andy Kipp
f798eeff93
Merge pull request #4908 from xonsh/anki-code-patch-2
Bump APPIMAGE_PYTHON_VERSION to 3.10
2022-08-03 19:42:42 +06:00
Noorhteen Raja NJ
dd6c873f3c
fix: empty gitstatus on paths without repo (#4907)
* fix: empty gitstatus on paths without repo

fixes #4900

* docs: add news item

* fix: failing test because of cache in git-dir per cwd
2022-08-03 19:09:43 +05:30