* feat: update command completions to show description as well
closes#3823
* test: fix failing tests on windows
* fix: failing tests on windows machine
* chore: adopt NEP-0029 for py version deprecation policy
fixes#4560
* chore: drop py3.6 from CI
* docs: add news item
* fix: failing qa because latest version to flake8-bugbear
see https://github.com/PyCQA/flake8-bugbear/issues/208
* chore: require >=py3.7
* feat: auto-completion support for source-foreign
* feat: add completions for source-bash/zsh/cmd
* refactor: change the boolean flags names that defaults to True
* feat: create field to define alias-completer
this will resolve checking parser or alias. Now the alias can define how
it completes.
will solve
https://github.com/xonsh/xonsh/pull/4267#discussion_r676066853
* docs:
* fix: mypy error
* fix: rst qa
* style:
* Fix: don't display welcome if $XONSHRC_DIR member is found
* Docs: add news item
* Update news/fix-xonshrc-dir-welcome.rst
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* Lint: black
* Update news/fix-xonshrc-dir-welcome.rst
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
If a directory was named for example '{RED}', that would get
interpreted as a color string and the prompt would not show the
direcotry name and would color it instead. Using dir names like
'{{foo}}' or simply '{' would break the prompt outright.
There was not much documentation on the prompt formating, but it seems
that escaping a curly by doubling it makes the prompt display all
curlies correctly.
fixes#4381
Calls to `suggest_commands` would result in repeated calls to
the Levenshtein distance routine, which whilst optimally
implemented is still expensive. The change proposes to cache the
result instead.
* Fix#4467
Fix for Crash with FileNotFoundError when current working directory is deleted
* Fix#4467
Fix for Crash with FileNotFoundError when current working directory is deleted
* Fix#4467FIx#4467
* Fix#4467
* Fix#4467
* Fix#4467
* feat: improve pip completer
* refactor: optimize imports
* fix: update tests for other completers
* fix: failing tests
* test: fix failing tests
* refactor: make error message clear
exception like KeyError will be more clear now
* qs import
* fix: failing tests on windows
* fix: failing tests on windows
* fix: failing tests on windows
* refactor: optimize imports
* feat: add new environment variable to customize tracing
* fix: failing integration tests
trace variable set from runner
* refactor: rename the variable to XONSH_TRACE_SUBPROC_FUNC
* Update xonsh/procs/specs.py
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* specs: Make sure sub-specs are always captured regardless of $XONSH_CAPTURE_ALWAYS
* procs: Ensure env is used in functional aliases
* news: Add always-capture-aliases
* tests: procs: Skip known issues
* tests: Restore all builtins in the 'xonsh_builtins' fixture
* tests: vc: Use monkeypatch to mock CommandsCache functions
* tests: main: Don't use the local machine's xonshrc
* Fix: EnvPath.add() not maintain uniqueness with Path objects on replace
* Update tools.py
Removed commented out code left in originally
* Add tests for EnvPath.add() function
* Add test for EnvPath.add() function with pathlib path
* Update tests for EnvPath.add() function to support winblows paths
* Fix xontribs meta page so github links clickable and one minor typo
* Update xonsh/xontribs_meta.py
updated as requested
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* environ: Implement InternalEnvironDict for thread-local overrides
* environ: Make `swap` thread-safe without leaks
Use thread-local storage to override the changes.
This way the changes can't leak to other threads.
* environ: Implement 'get/set_swapped_values' to pass to threads
* procs: Use swapped values in threaded subprocs
This is so the thread will use the same swapped values as the origin one.
* news: Add env-swap-thread-safety
* feat: use ArgParserAlias for history command
* feat: cli-utils: support parsing unknown args
* feat: use _unparsed for getting history slices
* fix: use show cmd as default
* fix: update history-diff to allow new format
* fix: make sure that history files are flushed
* fix: remove unused imports
* docs:
* fix: annotation error in older py versions
* refactor: split dispatch function
so that one can intervene before final call
* fix: py3.6-7 has no mock.call_args.kwargs properties
* fix: update _dispatch_func signature
* test: update tests for history-show parser
* fix: amalgam different import path
* fix: cli_utils not amalgamated
when importing as `from xonsh.cli_utils import ...` it is not lazy
loading
* Add relevant Trove classifiers
From full list: https://pypi.org/classifiers/
* Add all project URLs
* Add keywords
Copied from the repo's tags, minus "hacktoberfest"
* Add news entry for the change
* Use more explicit key for repo URL
* feat: use ArgparserAlias for xontrib
* test: add test for xontrib-name-completer
* fix: bashisms tests should unload module after tests
* test: make assertion failure message obvious
* fix: failing tests because autovox is already loaded in some py versions
* feat: use ArgparserAlias for xonfig
* test: update test for xonfig completions
* refactor: update docs
* refactor: use function based completer
* fix: remove old import
* docs:
* fix: merge issues
* test: move xsh_with_aliases to root conftest.py
* docs:
* feat: set subparser's prog from func-name
* feat: add colored help formatter and alias builder
closes#4284
* feat: add auto-completion support to argparser
* test: update test for completer
* fix: getting doc from params that have annotation
* refactor: use filter-function for checking alias completions
* doc: add discussion abount check for alias having parser
see discussion on
https://github.com/xonsh/xonsh/pull/4267
* type fix
* refactor: use function based completer
* test: fix failing argparser test
* docs: update news item
* update completion for argparser sub-commands to append_space
from comment on
https://github.com/xonsh/xonsh/pull/4267#discussion_r676044508
* docs: update docstring typo
* refactor: move inspect import to top
* feat: support option strings before positionals
and add env setting for showing completions for options by default
* test: update tests after adding new $ALIAS_COMPLETIONS_OPTIONS_BY_DEFAULT
* add suggested completion_context_parse fixture
* docs: add suggested doc for dispatch function
* refactor: use try/except for import of typing.annotated
* refactor: move complete_argparser_aliases to completers/aliases.py
* refactor: move argparser completer to its own module
* style:
* refactor: rename completer to not clash with argparse
* fix: expand option's descriptions
* fix: add completer/argparser to amalgam
* args: accept --rc dir to load dir/*.xsh
* test_main: add a test for --rc dir
* args: drop unused --config-path, not read anywhere
* news: add entry for rcdir changes
* xonshrc_context: return loaded instead of context, don't touch env
This function returned the context, but the return value is not used by
the sole call site (and would inconsistently be either the env or ctx
depending on other arguments). Redefine the function to return what was
loaded.
The function will also no longer touch the environment variables
XONSHRC, XONSHRC_DIR or LOADED_RC_FILES.
* XonshSession: add rc_files list, and set in start_services
* LOADED_RC_FILES: drop completely
* xonfig: add RC files
* test_main: update tests for changes to XONSHRC{,_DIR}
* news: add entry for xonshrc changes