Commit graph

2150 commits

Author SHA1 Message Date
Peter Ye
d08006b0e0
Change !() to also capture background subprocesses (#4406)
* Change !() to also capture background subprocesses

* Add test

* Add news

* Simplify logic
2021-08-01 21:58:19 +03:00
Daniel Shimon
f5acbe30d4
Ctrl backspace delete word (#4402)
* ptk: key-bindings: Add CTRL-Backspace to delete a single word

* news: Add ctrl-backspace-delete-word
2021-08-01 00:38:31 +03:00
Daniel Shimon
5322aafc66
Complete environment description (#4397)
* completers: env: Add env var's description

* news: Add complete-environment-description

* completers: env: Use generator

* completers: env: Show var type in display

* tests: completers: env: Update tests
2021-08-01 00:37:54 +03:00
Daniel Shimon
279d0ec638
Auto suggest word alias (#4401)
* ptk: key-bindings: Add CTRL-Right to auto-suggest a word

* news: Add auto-suggest-word-alias
2021-07-29 12:50:47 +03:00
Daniel Shimon
8dac83a9a0
Fix jedi path completion (#4400)
* xontrib: jedi: Don't complete paths with '~'

* tests: xontrib: jedi: Update tests

* news: Add fix-jedi-path-completion
2021-07-29 10:02:25 +03:00
Evgeny
6591346243
feat: add xontrib-homebrew (#4389)
replaces xontrib-linuxbrew by expanding OS support to Homebrew on macOS
2021-07-28 10:17:55 -04:00
Daniel Shimon
a72a9eb08e
Procs wsl1 check (#4387)
* xonfig: Print WSL version

* procs: Use pipeline groups in WSL2

* news: Add procs-wsl1-check
2021-07-26 16:34:00 -04:00
Daniel Shimon
e9b12c8b70 Updated CHANGELOG for 0.10.1 2021-07-24 22:47:37 +03:00
Gyuri Horak
98d4d2a184
Short color token name support for register_custom_style() (#4339) (#4342) 2021-07-24 18:37:51 +03:00
Jeremy Schlatter
09fcab65d2
fix surprising scoping behavior in execx and xonsh -c (#4363) (#4364)
* fix #4363

* fix test_integrations.py

* add tests for issue 4363

* fix regression

* add news item

* fix formatting with black

* fix news formatting
2021-07-24 17:17:37 +03:00
Daniel Shimon
91e8e52e76 Updated CHANGELOG for 0.10.0 2021-07-22 02:51:00 +03:00
Jeremy Schlatter
db99b64635
code simplifications (#4373)
* code simplifications

* add blank news item

There seems to be a CI check that requires this for each PR, But this
seems like it shouldn't be included in the next release notes, so I'm
leaving it blank.
2021-07-18 09:15:15 +03:00
Peter Ye
86f02c0341
Stop $() from silently capturing stderr (#4336)
* Stop $() from silently capturing stderr

* Add test
2021-06-24 09:43:21 -04:00
Peter Ye
9b79e4186e
Enable bracketed paste mode for readline (#4337) 2021-06-24 09:31:54 -04:00
Peter Ye
715fb867b4
Fix parser for subprocess command with leading whitespace (#4331)
* Fix parser for subprocess command with leading whitespace

* Add tests for subprocess leading space

* Add news

* Parameterize parser tests
2021-06-22 18:42:01 +03:00
Daniel Shimon
f87be90d6f
procs: Add $XONSH_CAPTURE_ALWAYS variable for opt-in interactive capt… (#4283)
* procs: Add $XONSH_CAPTURE_ALWAYS variable for opt-in interactive capturing

* tests: Add tests for $XONSH_CAPTURE_ALWAYS

* tests: Fix tests wrt $XONSH_CAPTURE_ALWAYS

* news: Add optional-interractive-capture
2021-06-21 12:36:37 -04:00
Peter Ye
d33d60ee3e
Fix the handling of colons when mixed with comments (#4332)
* Add ends_with_colon_token tool

* Add execer test for comment ending with a colon

* Use ends_with_colon_token() to catch non-indented blocks in execer

* Use ends_with_colon_token() for automatic indentation in prompt_toolkit and readline

* Add news
2021-06-20 12:50:03 +03:00
Noorhteen Raja NJ
33d2a1f04e
feat: make completer accept generators (#4319)
* feat: make completer accept generators

fixes #3968

* docs: add news item

* refactor: handle None value of $COMPLETION_QUERY_LIMIT
2021-06-20 12:42:30 +03:00
Daniel Shimon
8e547d0008
linux: Quote command-not-found argument (#4317) 2021-06-15 19:56:26 +03:00
Peter Ye
354f446f54
Fix empty command error message (#4308)
* fix pathsplit

* fix error message for empty command

* add news

* fix formatting

* fix atdollar_no_output test
2021-06-11 14:11:19 +03:00
Noorhteen Raja NJ
45b588c52e
feat: add config option to hide gitstatus prompt fields (#4294)
* refactor: create namedConstants for std colors

* feat: add gitstatus hide option

* test: update test_vc to not leak xsh object
2021-06-11 02:24:24 +03:00
JackofSpades707
a4ca034b9c
Address ON_WSL() bug #4310 (#4311)
* Address ON_WSL() bug #4310

Solution for #4310
`return "microsoft" in platform.release().lower() # might be a better solution?`
`return "wsl" in platform.release().lower() # might be a better solution?`

* Addressed #4310 - Added output for ON_WSL

For some reason this wasn't included in the output when running `xonfig`
Perhaps this was on purpose, but wsl is pretty popular and cygwin is detected so I figure I'd address that

* only display "on wsl" field if we detect linux

* Corrected import

* added news entry

* minor clarification in news entry

* Update news/fix_wsl_detection.rst

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

* Update news/fix_wsl_detection.rst

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

* This should pass CI tests

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-06-08 13:12:56 -04:00
Noorhteen Raja NJ
3ce8c9b337
add py310 (#4270)
* chore: adding py310 to ci

though this will require code/parser changes, this is to prepare for
upcoming adoption

* fix: set python version as string

* fix: reference to master -> main

* fix: coverage is not reported in master

- disable amalgamation
	1. during coverage report tests
	2. qa tools like mypy may follow imports
- use python 3.9 for coverage and qa report. since it will have more
coverage and better typing support

* chore: use py3.10 with setup-py action

* chore: add news-item check job

* fix: py3.10 error while starting

the match statement is not supported.
while the syntax support is only upto py3.8

* fix: news-item checker

* chore: enable fail report for py310 tests

* test: add test for ptk_shell
2021-06-07 13:40:40 -04:00
Daniel Shimon
099d301fae
Update completers tutorial (#4307)
* docs: completions: Improve RichCompletion and CompletionContext api docs

* docs: completers: Update tutorial

* completers: tools: Print non-default values in RichCompletion's __repr__

* completers: Add $XONSH_TRACE_COMPLETIONS variable

* news: Add update-completers-tutorial
2021-06-05 19:12:58 +03:00
Daniel Shimon
4c055d82e8
Update completer cli (#4299)
* completers: Add new completers after the non-exclusives

* completer: Print whether a completer is non-exclusive

* news: Add update-completer-cli
2021-05-30 09:42:55 +03:00
Daniel Shimon
7f8aeefae8
tests: Run tests with the amalgamated xonsh (#4290)
* tests: Run tests with the amalgamated xonsh

* tests: Test xonsh loads correctly interactively

* tests: Ensure tests run from amalgamated xonsh

* environ: Separate $XONSH_DEBUG and $XONSH_NO_AMALGAMATE

* tests: Keep XONSH_NO_AMALGAMATE in a comment for ease of debugging

* tests: Fix monkeypatch for amalgamated code
2021-05-28 15:42:37 +03:00
Chris Braun
63ad26997f
Handle cancelled futures in AsyncPrompt (#4286)
* Handle cancelled futures in AsyncPrompt

* Add changelog
2021-05-21 23:46:12 +03:00
Gordon Ball
e02c7d76c4
Test RC loading in different startup configurations (#4279)
* test_main: test lots of startup order combinations

This is based on the startup order described in
https://github.com/xonsh/xonsh/issues/4096#issuecomment-791991841
and adds an (ugly) parameterised test which tries lots of different
CLI combinations, and verifies which RC files (if any) get loaded,
and in what order.

* test_script_startup: skip on windows
2021-05-14 16:12:34 +03:00
Daniel Shimon
27db574d99
Fix annotated assignment (#4278)
* ast: Fix annotated assignment

* ast: Support annotated variable without a value

* tests: Test annotated assign statements

* news: Add annotated-assignment
2021-05-12 12:39:11 -04:00
Gordon Ball
d48c93bdb5
Add support for rc.d drop-in configuration directories (#4256)
* Add support for rc.d drop-in configuration directories

* main: change how --rc, --no-rc are handled

Explicitly pass --no-rc rather than signalling it as an empty --rc, to
indicate that we should suppress both XONSHRC and XONSHRCDIR in that
case.

* Rename XONSHRCDIR -> XONSHRC_DIR

* xonshrc_context: document setting env for XONSHRC_DIR

* main: --rc foo.xsh should suppress XONSHRC_DIR
2021-05-11 16:42:37 -04:00
Gyuri Horak
9400a7cbd4
Fix for crash if $XONSH_COLOR_STYLE is set to something invalid (#4253)
* Fix crash if gruvbox is set to something invalid

* unit test for `ansi_style_by_name` + news
2021-05-11 15:51:50 -04:00
Daniel Shimon
fe63279d26
Fix skip completer (#4263)
* completer: Refactor out complete_from_context

* completers: Fix `skip` completer calculation and completers invocation

* tests: Test commands completers

* news: Add fix-skip-completer

* completers: Make `complete_path` contextual
2021-05-11 15:49:45 -04:00
Andy Kipp
09b31bec10
feat: Add saving current working directory (cwd) to the history (#4271)
* Add saving current working directory (cwd) to the history

* Added XONSH_HISTORY_SAVE_CWD and create PromptHistorySetting section

* news

* Move dummy history to the distinct file

* tests

* tests

Co-authored-by: a <a@a.a>
2021-05-11 15:23:57 -04:00
Daniel Shimon
6df8fe9ba7
Non exclusive completers (#4259)
* completers: Move `apply_lprefix` to completers/tools.py

* completers: Implement non-exclusive completers

* completers: Make end_proc keywords and tokens non-exclusive

* completers: Implement environment vars non-exclusive completer

* news: Add non-exclusive-completers
2021-05-11 09:50:40 -04:00
Daniel Shimon
f960d4576f
Improve jedi completer (#4264)
* xontrib: jedi: Don't complete partial paths in commands

E.g. when completing "/bin/a" we don't want jedi to complete "/bin/abs"

* xontrib: jedi: Allow case-insensitive completions

* news: Add improve-jedi-completer
2021-05-11 13:10:58 +03:00
Daniel Shimon
35f1ba1819
Improve import completions (#4265)
* completers: import: Move `import` completer before `bash` completer

If this completer returns a result, it's definitely an import statement

* completers: import: Complete `import` keyword in `from ... import` statements

* news: Add improve-import-completions
2021-05-11 01:48:53 +03:00
Daniel Shimon
59819cf28f
Get obj name in help (#4266)
* help, superhelp: Use object `__name__` if it exists

* news: Add get-obj-name-in-help
2021-05-11 01:48:00 +03:00
Daniel Shimon
9f2b1419c7
Merge pull request #4275 from daniel-shimon/ptk-autopair-with-selection
ptk: Wrap selection with quotes/parens with $XONSH_AUTOPAIR
2021-05-11 01:43:34 +03:00
Daniel Shimon
3131e1c688
Merge pull request #4269 from daniel-shimon/ptk-disable-unwanted-clipboard-actions
ptk: Disabled unwanted clipboard actions
2021-05-11 01:41:45 +03:00
Andy Kipp
5c69e33b9b
Added history backend name to the xonfig. (#4272)
Co-authored-by: a <a@a.a>
2021-05-10 09:35:30 -04:00
Andy Kipp
0dc896c284
feat: Ability to call the program by name from callable alias with the same name without the infinite loop error (#4218)
* fix aliases infinite loop

* black

* cleaning

* skip_if_on_windows

* skip_if_on_windows

* bump tests

* bump tests

* skip test

* remove skipping test

* Update xonsh/procs/specs.py

Co-authored-by: Daniel Shimon <daniel.shimon22@gmail.com>

* Update xonsh/procs/proxies.py

Co-authored-by: Daniel Shimon <daniel.shimon22@gmail.com>

* Make alias names internal

* Tests

* Tests

* Tests

* tests

Co-authored-by: a <a@a.a>
Co-authored-by: Daniel Shimon <daniel.shimon22@gmail.com>
2021-05-10 09:30:41 -04:00
Daniel Shimon
8da682b7dc ptk: Disabled unwanted clipboard actions
Disable clipboard in the following ptk actions:
    ["kill-line", "kill-word", "unix-word-rubout", "unix-line-discard", "backward-kill-word"]
2021-05-09 22:41:31 +03:00
Daniel Shimon
0abdacce74 ptk: Wrap selection with quotes/parens with $XONSH_AUTOPAIR 2021-05-09 21:31:15 +03:00
Andy Kipp
6d0c23e16f
Close 4215: Added env variable to ignore ./ and ../ in filepath completion (#4241)
* Added env variable to ignore ./ and ../ in filepath completion

* Changed ignore_dots to complete dots as always, never, or upon matching

* Updated news

* Added default 'matching'

* Update ignore_dots.rst

* black

* fix test

* tests

Co-authored-by: Bailey Morgan <bailey.mccarty.morgan@gmail.com>
Co-authored-by: a <a@a.a>
2021-04-27 09:28:17 -04:00
Noorhteen Raja NJ
cb7db29991
Feature/speed up startup (#4106)
* feat: use saved commands_cache between runs

this will speed-up startup time by a small factor (around 0.15s on my
system with ssd and ryzen5)

* test: update env-variable handling for cmds-cache tests

* refactor: add env-variable to control saving commands-cache

* refactor: mypy error fix for commands_cache

* fix: update handling max(iterable

* test: add tests for commands-cache new version

* docs: update env variable doc

* test: add more test for commands-cache caching behaviour
2021-04-21 11:38:06 -04:00
Andy Kipp
039ce96dcd
feat: Added ability to get arguments list in ExecAlias (#4201)
* black

* news

* test

* alias_argN

* ExecAlias docs

* note about merge operator

* $args

* docs

Co-authored-by: a <a@a.a>
2021-04-15 09:39:13 -04:00
Andy Kipp
3785cbf8b4
XONSH_SUBPROC_CAPTURED_PRINT_STDERR to False (#4231)
Co-authored-by: a <a@a.a>
2021-04-13 13:21:43 -04:00
Andy Kipp
c243d4d86a
Put history json to subdirectory (#4211)
* New json history will be in XONSH_DATA_DIR/history_json directory.

* black

* exception + black

Co-authored-by: a <a@a.a>
2021-04-12 15:40:34 -04:00
Daniel Shimon
0ac7051db3
Improve bash completions - Pass parsed command line to py-bash-commands (#4219)
* completers: bash: Fix begidx calculation error

* completers: bash: Pass parsed args and quotes to py-bash-completion

* news: Improve bash completions
2021-04-12 15:37:35 -04:00
Andy Kipp
e7b0977910
feat: Added environment variable to hide unwanted printing the stderr when using captured object. (#4221)
* Added XONSH_SUBPROC_CAPTURED_PRINT_STDERR

* black

Co-authored-by: a <a@a.a>
2021-04-12 15:31:45 -04:00