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.
* 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
* refactor: use stdout passed from function
better handling of errors
* test: no need to skip these on windows
* test: load local plugin
* test: update vox-runin
* test: speedup vox tests
we dont need to test venv, only calls made to it via subprocess
* test: pip.exe on windows
fix: qa error, it is not a class method
still B019 is raised from bugbear
fix: failing vox tests in windows
fix: unc check on windows on ci
fix: vox failing on windows
get_binary_path already appends .exe
* fix: pip -r appends spaces at the end
modularize completing output from subproc-out
* docs:
* fix: flake8
* fix: failing pip comp tests
* refactor: naming xonsh conflicts with actual package
the IDE completions don't work.
we add this naming convention instead.
* feat: option to filter after completion returned
this will help reduce some boilerplate, and we can enrich the filtering
behaviour
* feat: add gh completions
* fix: filtering out completions
* refactor: simplify invoking completer interface
* test: add fixture for xsh with os-env
* test: add tests for gh-completions
* fix: flake error
* fix: mypy errors and update gh completer tests
* fix: handle cross-platform line endings
* feat: include man,bash completer only if available
* todo: improve man page completions
* fix: failing man page tests
* fix: py 3.7 compatibility
* fix: qa error
* fix: stop dir completions
* feat: improve man page completions
now shows descriptions, recognizes more number of options correctly
* fix: update man page completions
* feat: support filtering based on display as well
* Update xonsh/completer.py
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* style:
* test: xfail ptk-shell tests on windows
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* Add uname support
* Changelog addition
* Migration to platform module
* Update uptime.py for the last version
Merge the original uptime module to a single file
Change the bootime() return be stay compatible with xonsh
Add support for Haiku , suppose to close#3882
Add dependency from uptime to support to MacOS 10.10 by add _posix.c file.
* Update uptime.py for the last version
Merge the original uptime module to a single file
Change the bootime() return be stay compatible with xonsh
Add support for Haiku , suppose to close#3882
Add dependency from uptime to support to MacOS 10.10 by add _posix.c file.
* typo fix
* black reformat
* remove usage of print
* black is black
* add original test for uptime
convert original test via 2to3
black reformat tests
* strange syntaxe fixe for flaske8
* black the incredible tool it stop a bug fixe just because it THE tool it want a return for make less readable code
* flake8 the famous tool it permit to stop a big fixe without any information's about the trouble
* workaround about xonsh CI don't respect docstring specs
* RISC OS only comment thing
* black is a good jock in a CI
* black is a good jock in a CI
* roll back uptime.py
* look if we can make it work
* fixe all i understand
* add command in corutils alias
* reformat uptime.py with black
* fixe version
* try with xonsh xp.LIBC lib
* black in a CI is a stupid thing
* stupid Windows and it \r
* use os.linestep
* use newline simple wrapper
* use newline simple wrapper
* use newline simple wrapper
* use newline simple wrapper
* try osx rollback method
* fixe
* fixe
* a test on window via the CI because i haven't the OS
* a test on window via the CI because i haven't the OS
* a test on window via the CI because i haven't the OS
* fix: black: format
* refactor: update uname command
now has auto-completions
* docs: update news item and fix qa error
* refactor: remove unused file
* fix: qa imports
* refactor: update getting boottime
fallback to monotonic time on unix
* fix: update haiku compatibility in uptime
* refactor: add uptime to aliases
* refactor: move xoreutils tests
* fix: call aliases using xonsh
Co-authored-by: Tuux <tuxa@rtnp.org>
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>
* todo
* test: remove usage of DummyEnv and setting .env attribute on xession fixture
one step closer to making too much of tweaking to xession during tests
* test: fix tests vox and gitstatus-prompt
* docs: update test-fixture usage
* fix: import flake8 error
* test: remove direct access to XSH in tests
* test: remove usage of XSH in test files
* todo
* test: use tmp-dir to create stubs
* refactor: use fixture factory to mock out XonshSession
* refactor: remove direct access of XSH from functions
* refactor: remove direct access of XSH from functions
* fix: qa checks
* refactor: rename variables to match their values
* test: update failing tests because it had no PATH set previously
* fix: remove builtins usage from pyghooks.py
* style:
* refactor: update tests to use fixtures
* fix: env varialbe is setup per function
some tests accidentally update the env variables and that is leaking
into next tests
* fix: failing vox tests
* test: set commands_cache per test
* test: fix failing tests
* fix: failing tests on linux
ptk-highlight
* fix: failing tests on Windows
cwd-prompt
* test: copy env as to not affect original object
* fix: lazily evaluate cmds-cache in pyghooks
* test: fix failing tests
* fix: qa errors import
* test: set commands-cache per test
while caching path results
* test: speedup test_thread_local_swap
* fix: failing tests on windows
* refactor: Execer doesn't control session
* refactor: XSH.unload will take care of reversing builtins attrs set
* test: use env.update over monkeypatch
* Revert "test: use env.update over monkeypatch"
This reverts commit 010a5022247a098f1741966b8af1bf758663480e.
* feat: use NumpyDoc to represent Parsed docstring
in cli_utils.py
* feat: set argparse boolean option from default values
* refactor: shorter Arg in annotation
by following convention in cli_utils.py
* fix: get description without Parameters
* fix: qa errors
* 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
* refactor: remove usage of global variables in abbrevs.py
* chore: add flake8-mutable to prevent mutable defaults
* fix: abbrevs expand test
* refactor: add xonsh session singleton
* refactor: fix circular errors when using xonshSession as singleton
* refactor: remove black magicked builtin attributes
* style: black format tests as well
* refactor: update tests to use xonsh-session singleton
* refactor: update abbrevs to not use builtins
* test: remove DummyCommandsCache and patch orig class
* fix: failing test_command_completers
* test: use monkeypatch to update xession fixture
* fix: failing test_pipelines
* fix: failing test_main
* chore: run test suit as single invocation
* test: fix tests/test_xonsh.xsh
* refactor: remove builtins from docs/conf.py
* fix: mypy error in jobs
* fix: test error from test_main
* test: close xession error in test_command_completers
* chore: use pytest-cov for reporting coverage
this will include subprocess calls, and will increase coverage
* style:
* completion-context: Add CompletionContextParser placeholder
Implements the xonsh (tab-)completion context parser.
This parser is meant to parse a (possibly incomplete) command line.
* completers: tools: Implement ``contextual_completer`` decorator
This is used to mark completers that want to use the parsed completion context.
* completers: Enable using contextual completers in xonsh/completer.py
* completers: readline, ptk, jupyter: Enable using contextual completers
Pass ``multiline_text`` and ``cursor_index`` to ``Completer.complete()``
* parsers: base: Refactor out a ``raise_parse_error`` function
* tokenize: Enable ``tolerant`` mode
If ``tolerant`` is True, yield ERRORTOKEN instead of
throwing an exception when encountering an error.
* lexer: Enable ``tolerant`` mode
Tokenize without extra checks (e.g. paren matching).
When True, ERRORTOKEN contains the erroneous string instead of an error msg.
* tests: lexer: Test ``tolerant`` mode
* completion-context: Implement simple CommandContext parsing
* completion-context: tests: Test simple CommandContext parsing
* completion-context: Implement parsing sub-commands
* completion-context: tests: Test parsing sub-commands
* completion-context: Add news file
* completion-context: parser: Add parser table path to relevant locations
Code-coverage, mypy ignore list, etc.
* completion-context: Implement parsing partial strings and line continuations
* completion-context: tests: Test parsing partial strings and line continuations
* completion-context: Convert ``Span`` object to a ``slice``
* completion-context: Refactor out ``create_command`` and ``cursor_in_span``
* completion-context: Implement handling empty commands
* completion-context: tests: Test handling empty commands
* completion-context: Implement handling multiple commands
Separated by newlines, `;`, `and`, `or`, `|`, `&&`, `||`
* completion-context: tests: Test handling multiple commands
Separated by newlines, `;`, `and`, `or`, `|`, `&&`, `||`
* completion-context: Implement handling python context
* completion-context: tests: Test handling python context
* completers: tools: Add `contextual_command_completer`
* completers: Make `complete_skipper` contextual
* completers: Make `complete_from_man` contextual
* completers: Make `complete_from_bash` contextual and add test
* completers: Make `complete_pip` contextual and update tests
* completers: Keep opening string quote if it exists
* completion-context: Handle cursor after a closing quote
For example - cursor at the end of ``ls "/usr/"``.
1. The closing quote will be appended to all completions.
I.e the completion ``/usr/bin`` will turn into ``/usr/bin"``
2. If not specified, lprefix will cover the closing prefix.
I.e for ``ls "/usr/"``, the default lprefix will be 6 to include the closing quote.
* completion-context: tests: Test handling cursor after a closing quote
* completion-context: Fix bug with multiple empty commands
e.g. `;;;`
* completion-context: tests: Speed up tests
From ~15 seconds to ~500 ms
* completion-context: Expand commands and subcommands
* completion-context: Simplify `commands` rules
* completion-context: Simplify `sub_expression` rules
* completion-context: Simplify editing a multi-command token
* completion-context: Inline `create_command`
* completion-context: Implement `contextual_command_completer_for` helper
* completers: Make `complete_cd`/`complete_rmdir` contextual and add tests
* completers: path: Don't append a double-backslash in a raw string
When completing a path, if a raw string is used (e.g. `r"C:\Windows\"`),
there's no reason to append a double-backslash (e.g. `r"C:\Windows\\"`).
* completers: Make `complete_xonfig`/`complete_xontrib` contextual and add tests
* completers: Make `complete_completer` contextual and add tests
* completers: Make `complete_import` contextual and add tests
* completion-context: Add python `ctx` attribute
* completion: tools: Simplify `RichCompletion` attributes handling
* completers: Make `base`, `python`, and `commands` contextual
* Add tests
* No need for `python_mode` completer anymore
* completion: tools: Add `append_space` attribute to `RichCompletion`
* completion-context: Get all lines in a main python context
* xontrib: jedi: Make the `jedi` completer contextual
* completers: tools: Remove `get_ptk_completer` and `PromptToolkitCompleter.current_document`
These aren't needed anymore now that contextual completers can access the multiline code (via `PythonContext.multiline_code`).
* completion-context: ptk: Expand aliases
* completion-context: jupyter: Expand aliases and fix line handling
* completer: Preserve custom prefix after closing quote
* completers: bash: Ensure bash completion uses the complete prefix
* completers: pip: Append a space after a pip command
* completers: pip: Prevent bad package name completions
* completers: Remove a common prefix from `RichCompletion` if `display` wasn't provided
* completion-context: Treat cursor at edge of `&& || | ;` as normal args
This will be used for completing a space
* completers: Complete end proc keywords correctly
Without the brackets python defaults to assuming that the iterable is a tuple. In the reference guide `__all__` is explicitly stated to be of type `list`.
Functionally I'll admit this doesn't change anything but to observe the correct usage pattern of `__all__`, simply add the brackets.
* refactor: rewrite xontribs/jedi.xsh -> xontribs/jedi.py to take advantage of python tooling
* chore: update elm ci workflow
* test: update test for jedi xontrib