Commit graph

2098 commits

Author SHA1 Message Date
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
Andy Kipp
309188e9fc
Create ujson.rst 2022-08-03 19:29:28 +06:00
Andy Kipp
44a894686e
Create appimage.rst 2022-08-03 19:18:38 +06:00
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
Gil Forsyth
2d75729962
fix(styles): fall back to default style if style not found (#4906)
The fallback is already the default behavior if the user has `pygments`
installed, but if they don't we were awkwardly bailing out here and
preventing startup.
2022-08-03 11:35:28 +05:30
Gil Forsyth
649fad8a7c
fix(xpip): never add sudo, append --user instead (#4879) 2022-07-14 23:35:40 +05:30
Gil Forsyth
386f9542ff Updated CHANGELOG for 0.13.0 2022-07-08 09:38:09 -04:00
cmidkiff87
ce0b8e04c6
Fix free_cwd xontrib loading (#4865)
issue #4864
see also: ecc1ab1020
2022-07-05 22:13:30 +05:30
Gil Forsyth
013fa760a0
refactor(amalgamate): remove amalgamation (#4858)
Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2022-07-04 10:40:16 +05:30
Eddie Peters
8b9a7e2782
fix(pyghooks): Fix some errors caused by an unset Xonsh session env when using XonshLexer as a Pygments plugin. (#4860) 2022-06-30 10:40:58 -04:00
Hannes Römer
349dee75a3
#4845: conditional import of ptk_win32 → windows only (#4853)
* #4845: conditional import of ptk_win32 -> windows only

* #4845: added news entry

* #4845: moved news entry to separate file
2022-06-28 07:51:34 +05:30
Gil Forsyth
5401a246c6 Updated CHANGELOG for 0.12.6 2022-06-21 10:44:07 -04:00
Peter Ye
ed213f852b
fix: string literal concatenation (#4838)
* fix: string literal concatenation

Fix string literal concatenation involving f-strings and path literals.
Raise SyntaxError when string literal concatenation is attempted between
different literal types (e.g. str and bytes).

* Add tests

Make nodes_equal() check whether the values of Constant nodes are equal.

* add news

* update nodes_equal() error msg
2022-06-18 08:34:34 +05:30
Gil Forsyth
db5141006e Updated CHANGELOG for 0.12.5 2022-06-17 12:46:08 -04:00
amukher3
84c349f142 Fixed the syntax error for "timeit" function 2022-06-13 01:22:40 +05:30
Peter Ye
b2c42ed2f3
feat: f-glob strings (#4835)
* feat: add support for f-glob strings

Move xonsh_pathsearch() into the BaseParser class because it needs to use self._set_error()

Parametrize 6 backtick tests in test_parser.py into test_backtick() (and add cases for f-glob strings)

* add news

* docs: update tutorial

* fix news file
2022-06-12 13:45:16 +05:30
Peter Ye
0202affb1a
Fix ExecAlias return value (#4829) 2022-06-06 10:43:22 +05:30
Peter Ye
be604e7f48
Change ![] to return an object for background command (#4823)
* Change ![] to return an object for background command

* Fix `fg` for commands started in the background

Fixes #4595

This issue was caused by `CommandPipeline.term_pgid` not being set for commands started in the background.
2022-06-05 21:10:21 +05:30
Italo Cunha
1e81146bd6
Support deletion in whole_word_jumping xontrib (#4788)
This binds Alt/Control+Delete/Backspace to support deletion matching
the motion bindings in `whole_word_jumping`.

Should work mostly out of the box on terminals that generate `\x7f`
when `backspace` is pressed and `\x08` when `control+backspace` is
pressed.  Tested to work on Microsoft Terminal (WSL2).  For
incompatible terminals, users can set `$XONSH_WHOLE_WORD_CTRL_BKSP
= False` to avoid configuration of the `control+backspace` binding.
2022-06-05 20:38:06 +05:30
Noorhteen Raja NJ
ecc1ab1020
xontrib load/unload (#4817)
* feat: add function to make event registration from function signature

* docs: add xontrib special functions description

* feat: handle xontribs with special functions

also reduce usage of XSH singleton

* fix: missing XSH

for now import singleton

* docs: fix .rst format

* fix: failing tests

* feat: implement primitive xontrib-unload and xontrib-reload

* chore: give explicit name

* docs: update doc
2022-05-30 15:33:17 +05:30
jbw3
42f081c8c7
Documenting the HISTCONTROL ignorespace option (#4825) 2022-05-28 21:22:27 +05:30
Peter Ye
259fbe540c
fix: do not append empty/comment-only input to history (#4822)
* add test for importing empty .xsh file

* test: empty lines do not get appended to history

prompt-toolkit needs its own test outside of test_base_shell.py because it uses a custom _push() method

* fix: do not append empty/comment-only input to history

Adds a compile_empty_tree argument to Execer.compile()
By default, the argument is `True`, and `compile()` returns a compiled `pass` statement for comment-only input.
When the argument is `False`, `compile()` returns `None` for comment-only input.

The base shell and prompt-toolkit shell use `compile_empty_tree = False` so that they get `None` as the compiled code and don't append the command to the history.

* add news

* fix tests
2022-05-26 17:50:08 +05:30
Noorhteen Raja NJ
93821fb363
refactor: removing prompt_ret_code xontrib (#4815) 2022-05-23 10:18:11 -04:00
Noorhteen Raja NJ
1e4eb3ade0
feat: filter completions from fish (#4765)
* feat: filter completions from fish

* docs:
2022-05-22 22:44:36 +05:30
Timmy Welch
b123273319
Fix environment variable completion in strings (#4804) 2022-05-21 10:54:36 +05:30
Peter Ye
11b2d6d086
Send SIGHUP instead of SIGKILL to clean up jobs (#4811)
Allows `nohup` command to work properly.
2022-05-20 23:09:24 +05:30
Gil Forsyth
400d2d6c56
fix: workaround method calls on attributes set to None (#4812) 2022-05-20 22:45:15 +05:30
Peter Ye
57f1e4bcbd
Fix bg command behaviour (#4810) 2022-05-20 08:45:03 +05:30
Gil Forsyth
572ebb576d
docs: change theme to furo (#4809)
Trying out a new theme -- I really like the way `furo` looks and I think
it makes it easier to navigate our overly dense docs pages.
2022-05-18 20:36:45 +05:30
dev2718
e62c0e9cec
Returncode enhancements (#4798)
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2022-05-10 09:43:32 -04:00
Gil Forsyth
8933eb9d33 Updated CHANGELOG for 0.12.3 2022-05-08 16:58:38 -04:00
Noorhteen Raja NJ
15ff663530
Rm xontrib meta (#4790) 2022-05-04 15:02:20 -04:00
Peter Ye
baa4ade262
fix: item order of pretty-printed dictionaries (#4786) 2022-04-30 08:25:52 +05:30
doronz88
22cb921686
fix: remove os.path.basename from _get_git_branch() (#4783) 2022-04-27 22:11:13 +05:30
Noorhteen Raja NJ
73a880f76a
chore: drop py3.7 (#4770) 2022-04-26 09:00:31 -04:00
Gil Forsyth
e0a0394bfc Updated CHANGELOG for 0.12.2 2022-04-25 10:52:15 -04:00
Noorhteen Raja NJ
5da6a1babc
fix: gitstatus prompt (#4772) 2022-04-23 07:01:04 +05:30
Peter Ye
e1dc61eb04
fix: completions for command argument paths after equal signs (#4767)
* fix: completions for command argument paths after equal signs

* found a better solution to the problem
2022-04-21 21:08:30 +05:30
Noorhteen Raja NJ
ed9f032a47
Some fixes (#4763) 2022-04-17 10:06:08 +02:00