* Fix tab-completion trailing space for command arguments that use equals sign
* Add test for completion of path ending with equal sign
* Move test_path_completers.py to tests/completers
* Restore _quote_paths() to original behaviour
* Apply trailing equal sign fix to _bash_quote_paths()
Use _bash_quote_paths instead of _quote_paths in complete_from_bash()
* Do not need to pass quote_paths=_bash_quote_paths
We shouldn't fail to start if the available PTK version doesn't support
modal cursor stuff.
(We should probably also make modal cursor stuff optional, but that can
happen later)
* Fix regex globbing for paths that contain special regex characters
* Skip regex globbing asterisk character tests on Windows
Asterisks are forbidden in Windows filenames. Plus signs are allowed in Windows filenames, so the plus sign tests run properly.
* Added reference to ``PROMPT_FIELDS`` section in ``time_format`` definition
* Forgot the news item, added now
* Generalized reference to PROMPT_FIELDS
* fix: ptk now support modal cursor shape, use it when vi_mode is enabled
* lint: use double-quotes
* bump ptk dependency in setup and integration
* lint: sorting imports
* feat: initial match statement support
* refactor assignment exprs for <3.8 compatibility; sort imports
* remove match extensions
* bump qa-workflow python version, minor alterations for qa-pipeline
* add mypy exception
* update mypy version
* Bump workflow main python version to 3.10
* remove outdated note
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
fixes#4670
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.
This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.
fixes#4670
* make env_name aware of prompt in pyvenv.cfg
prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.
As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.
This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.
fixes#4670
* add type annotations
* always return str
This is more consistent and might also deal with a mypy error only observed on Ubuntu Linux python3.9
* remove unnecessary import
* adapt code to not break the documented API
When restructuring the code, I did not know that this was part of a documented API. This restores the API functions and updates the doc strings. New helper functions have been made private.
* feat: better stacktraces
* reraise SystemExit to enable proper exit codes and maintain old
behaviour in repl
* dont ignore exceptions when loading rc-files
* update tests with new SyntaxError formatting, new behavior that main
does not throw user exceptions
* pull return out of finally (flake8, B012)
* hide XonshError traces, fix mypy error, enable circumvention of trace suppression
with XONSH_DEBUG in non-interactive use
* fix mypy error
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
* Add xontrib-gruvbox to xontribs_meta.py
* Add news item for xontrib-gruvbox
Co-authored-by: Ryan Delaney <ryan.patrick.delaney+github@protonmail.com>
* 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>
* Refactor: code can *only* be None in else case.
* Refactor: make xonsh_code private as `_source`
* Refactor: make "token_stream" private
* Refactor: make "tolerant" private
* Refactor: add default for _token_stream
* Feat: implement Lexer.reset
* Refactor: cleanup local names in Lexer
* Refactor: make `source_slice` private.
Again, this is just a helper function so for now make it private.
* Refactor: use chained comparison
* Docs: add news
* Update refactor-lexer-parser.rst
Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.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>
* Refactor: Don't modify XSH in Execer
This is not an invariant change - the __del__ method of the execer now does not unload the session. This is probably what we want - the session should be the final arbiter of when it goes out of scope, and we might need an explicit mechanism to handle this.
* Refactor: make import hook Execer explicit
This is ugly for now, but helps raise the global state modifications to the surface
* Style: run black
* Refactor: add `update_cache` to `CommandsCache`
Previously a lot of internal usage of `all_commands` was for the updating side-effect. Now we make that a separate routine.
* Refactor: remove args from XonshSession constructor
* Refactor: move non stateful XonshSession methods to __init__
* Refactor: don't create custom class for namespace
* Refactor: auto-generate set of default builtins
* Refactor: set session attributes to None in constructor
* Refactor: don't test hasattr for known attribute
* Refactor: add methods to restore and disable Python exit
* Refactor: add initial value for XSH.aliases
* Refactor: don't default getattr for known attribute
* Refactor: make _lastflush a closer and move to `load()`
* Fix: catch $path even if empty.
This shouldn't ever actually manifest itself, but whilst we're here!
* Refactor: support existing usage of install_import_hooks
* Style: run black
* Refactor: remove unneeded import
* Docs: add news item
* Fix: news item
* Refactor: remove unused arg
* docs: fix news item
* fix: no duplicate calls
add helpers properties to completion-context
* refactor: importing a module should not affect the session
the user has to have XSH loaded before
* fix: todo item for testing imphooks
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>