Releases: xonsh/xonsh
Releases · xonsh/xonsh
0.19.1
0.19.0
Added:
- Env: Added
$XONSH_SUPPRESS_WELCOME
variable to suppress the welcome message.
Changed:
- Replaced
case_insensitive_dictionary
dependency with localCaseInsensitiveDict
class.
Fixed:
- Parsers: support python3.13: fix deprecation warnings.
- Fix DeprecationWarning while initializing Expression.
Authors:
- Evgeny
- doronz88
- JamesParrott
- Jueun Lee
- Simon Billinge
- Bala
- Gil Forsyth
0.18.4
Changed:
- Now SystemExit that invoked from callable alias follows to exiting from callable alias instead of exiting the entire shell.
Fixed:
- Built-in commands such as
xonfig -h
andxontrib -h
no longer cause the shell to exit. - Fixed incorrect quoting behaviour in
activate.xsh
for virtualenv version 20.26.6.
Authors:
- anki-code
- pre-commit-ci[bot]
- Peter Ye
- Max Nordlund
- Shawn Wallace
- Faidon Liambotis
0.18.3
Added:
- executables: Added
locate_relative_path
functionality tolocate_file
.
Changed:
$MULTILINE_PROMPT
changed from'.'
to' '
(space)
to have an ability to copy the multiline functions from shell history without deleting the dot manually (#5624 #5634).
Fixed:
- Fixed
$AUTO_CD
regress after previous refactoring. - Partial fix for "Bad file descriptor" in case of callable alias with execx invocation inside e.g. ExecAlias (#5645).
- completer: Fixed exception when in python-only completion context (#5632).
- Fixed exception "object has no attribute readlines" in case of redirect callable alias output.
Authors:
- Gil Forsyth
- Noortheen Raja
- anki-code
- pre-commit-ci[bot]
- Aidan Courtney
0.18.2
0.18.1 (deprecated)
- Maintenance
0.18.0 (deprecated)
Key points in this release from @anki-code:
- Completion of the "decorator alias" concept. See also xontrib-dalias.
- Performance improvements after introduction of new resolver for Linux and Mac. Testing Windows is in progress, waiting for reports.
- Refactoring of internal structure.
Added:
- Added
@aliases.return_command
decorator to eliminate the need to wrap the logic for modifying command into callable alias wrapper (#5473 by @anki-code). - aliases: Added ability to set multiple decorator aliases e.g.
j = $(@json @noerr echo '{}')
(by @anki-code). - Tutorial: added example of callable environment variable (by @anki-code).
- env: Added
$XONSH_MODE
variable to detect the current execution mode:
interactive
,script_from_file
,source
,single_command
,script_from_stdin
. (by @anki-code) - Builtin:
exit
can return exit code e.g.exit 71
. (by @anki-code) - builtin: added
__xonsh__.imp
to have an ability to import and use modules immediately in one line
e.g.__xonsh__.imp.json.loads('{}')
. (by @anki-code)
In the future__xonsh__
will have short notation@
and the line will looks more elegant@.imp.json.loads('{}')
. - builtins: Added color to printx e.g.
printx('Good', 'GREEN')
as short alternative toprintx('{GREEN}Good{RESET}')
. (by @anki-code) - Created
xonsh.api
to use xonsh functionality in pure python code and downstream projects (#5383 #5538).
It's usable but don't treat this serios because it's mostly to move some functions into distinct
submodule to reflect the intention to have the API. We need review and improvements here. (by @anki-code) - tools: added
mkdir
toxonsh.tools.chdir
e.g.with chdir('/tmp/new', mkdir=True): pass
. (by @anki-code)
Changed:
- New executable resolving method was introduced and the commands_cache usages were replaced in the key places. As result we expect speed up in xonsh startup, reducing lagging during typing in prompt and speed ups during the commands execution (#5544 by @anki-code).
COLOR_RESULTS
switched toFalse
for non-interactive command case to improve speed in default behavior (#5562).- main: Importing sqlite became optional. (by @anki-code)
- prompt: Switching to prompt_toolkit in edge case of sending stdin to interactive mode (#5462 #5517 by @anki-code).
- Rename:
SpecModifier
,xthread
,xunthread
renamed toDecoratorAlias
,@thread
,@unthread
to support idea that
spec modifier is like a Python decorator. (by @anki-code) - Big refactoring of internal modules structure to give clear understanding of internal xonsh components (#5538).
E.g. if you haveimport xonsh.jobs
convert this toimport xonsh.procs.jobs
.
This kind of refactoring occurs once per many years. (by @anki-code)
Deprecated:
- Starting from this release we notify that in the future we will not recommend to use
xonsh.procs.run_subproc
andxonsh.built_ins.subproc_*
functions for downstream projects because of #5383.
We will developxonsh.api
as alternative.
Removed:
- xontrib: Do not autoload xontribs in
xonsh --no-rc
mode. (by @anki-code)
Fixed:
- Callable alias: fixed capturing stdout in case of redirect e.g.
a > file
(#5527 by @anki-code). - Commands Cache: Fixed cache update logic that lead to lagging during typing. (by @anki-code)
- Replaced deprecated
sys.last_type, sys.last_value, sys.last_traceback
withsys.last_exc
. (by @kulkarniniraj) - Fixed
history gc
invocation failing whensqlite
history backend is used. (by @jnoortheen)
Authors:
- anki-code @anki-code
- Jason R. Coombs @jaraco
- Noortheen Raja @jnoortheen
- lunrenyi @lunrenyi
- Spencer Bliven @sbliven
- Niraj Kulkarni @kulkarniniraj
- Gil Forsyth @gforsyth
0.17.0
Key points in this release from @anki-code:
- This release is highly recommended. Please update your xonsh and be ready to update to upcoming xonsh >= 0.18.2 with refactoring.
- Added stripping the trailing new line character - the long awaited feature. So now you can run just
id $(whoami)
. - Added
$XONSH_SUBPROC_OUTPUT_FORMAT
to manage the output format. - Added
SpecModifierAlias
that allows manage the specification of the process in the command e.g.j = $(@json curl http://)
. See examples in xontrib-spec-mod, #5481, #5443, #5494. UPD: will be renamed toSpecDecoratorAlias
in next release. - Fixed a bunch of issues around treating the process signals, exit codes and cases when process was suspended by OS.
- Fixed a bunch of "Bad file descriptor" and IO issues that were related to big refactoring in the past.
- We started https://xonsh.zulipchat.com to publish news, solve cases and chatting.
- Huge amount of other changes and fixes that were covered by many new tests.
Added:
- Added
$XONSH_SUBPROC_OUTPUT_FORMAT
to switch the way to return the output lines.
Defaultstream_lines
to return text. Alternativelist_lines
to return
the list of lines. Now you can rundu $(ls)
without additional stripping.
Also supported custom lambda function to process lines (if you're looking for
alternative to bash IFS). Use #5481 if you want to manage output in the command. (by @anki-code) - Added
SpecModifierAlias
class to have an ability to create alias that modifies spec before run e.g.xthread
alias. (by @anki-code) - Saving history in case of any type of exiting the shell (by @anki-code).
- Added
xthread
andxunthread
aliases to force command running as threaded and unthreaded. (by @anki-code) - Reading stop signals from the process and update the process state (#5361) (by @anki-code).
- Now last executed CommandPipeline is available in
__xonsh__.last
. (by @anki-code) - Added
xonsh --no-env
option to run xonsh without inheriting the environment variables. Now by runningxonsh --no-rc --no-env
you have pure xonsh session. (by @anki-code) - Added support of NixOS core tools in
predict_threadable
. (by @anki-code) - Added catching an exceptions during load a history backend to avoid shell exiting e.g. on permission error (by @anki-code).
- Added catching an exception when cache file is not writable (by @anki-code).
- Saving history on SIGINT. Development tools like PyCharm send SIGINT before killing the run
and doing this is the last chance to save history. (by @anki-code) - Added FuncAlias to process callable aliases (by @anki-code).
- Added alias name printing in case of exception in alias (by @anki-code).
- Added thread class, name, func and alias names to thread exception for easy understanding the source of issue. (by @anki-code)
- Added
spec.raise_subproc_error
for fine-tuning exceptions viaSpecModifierAlias
(#5494). (by @anki-code) - Added catching ChildProcessError in jobs. Avoiding hanging aliases in some cases (by @anki-code).
- Added mode
$XONSH_TRACE_SUBPROC=3
to show more information about pipeline. (by @anki-code) - Added
env.detype_all()
to get all available variables that is possible to detype (by @anki-code). - Added "Callable alias and capturing" to the tutorial. (by @anki-code)
- Xonfig: show sensitive env variables that could affect the shell behavior. (by @anki-code)
- Added section "Use the Nix Package manager with Xonsh" to "Platform-specific tips and tricks" (by @anki-code).
- Added xonsh support into Jupytext project! Jupytext is to store Jupyter notebooks as a plain text documents.
- Added shortcut
-st
for--shell-type
. (by @anki-code)
Changed:
- Now the ending new line symbol
\n
will be stripped from the single line output.
For$(whoami)
you will get'user'
instead of'user\n'
. (by @anki-code) - The home based
~/.xonshrc
will not be executed in non-interactive mode (#5491). (by @anki-code) - Env variables completion: now use substring for search and then sort results by the position of substring and then alphabetically. PR 5388. (by @anki-code)
- Xonsh AppImage downgraded to Python 3.11. We need to resolve 3.12 parser support (5166) before upgrade. (by @anki-code)
- jobs: default representation changed to dict. (by @anki-code)
- The CommandPipeline repr will not show descriptors by default. Use XONSH_DEBUG mode to see them. (by @anki-code)
- Cleaning logic and functions around threading and capturing in
procs/specs.py
file. (by @anki-code) - Prompt:
env_name
will have yellow color by default. (by @anki-code) - Show
root
and@#
in prompt if user is superuser. (by @anki-code) $XONSH_TRACE_SUBPROC=2
returns more useful details. (by @anki-code)- Minor cleanup of
commands_cache
, unifying behavior across platforms. (by @jaraco)
Removed:
- No longer is
.
implied for running commands on Windows. Instead the behavior is the same across platforms. Windows users will need to prefix./
or.\
to run commands from the current directory (#5476). (by @jaraco) - Unpin prompt-toolkit version (#5438). (by @anki-code)
Fixed:
- Fixed populating the return code for interrupted process. (by @anki-code)
- Fixed
Bad file descriptor
and I/O errors after running callable alias (#5435). (by @anki-code) - Fixed processing exit signals and exceptions (e.g. SIGHUP in #5381) to provide careful exiting with right exit code and TTY cleaning. (by @anki-code)
- Fixed redirect with python substitution e.g.
echo 1 > @('/tmp/file')
is working now. (by @anki-code) - Fixed
xonsh -DVAR=VAL
behavior: initiate env variables before shell initialization. (by @anki-code) - Prevent exception on start up if
dircolors
util is wrong. (by @anki-code) - Fixed showing exception message in some cases. (by @anki-code)
- Fixed empty stacktrace for CalledProcessError. (by @anki-code)
- Fixed showing alias description using superhelp e.g.
which?
. (by @anki-code) - Fixed
TypeError
in xoreutils. (by @anki-code) - Commands on Windows now honor the case as they appear on the file system (#5469). (by @jaraco)
- Windows: fixed path to RC file in
xonfig web
. (by @anki-code)
Authors:
- anki-code @anki-code
- Jason R. Coombs @jaraco
- Gil Forsyth @gforsyth
- Noortheen Raja @jnoortheen
- Peter Ye @yaxollum
- doronz88 @doronz88
- jyn @jyn514
- l-no @l-no
- amacfie-tc @amacfie-tc
0.16.0
Added:
- Square brackets can now be used in command arguments without quotes (e.g.
echo a[b]
) - Add
XONSH_BASH_PATH_OVERRIDE
option (off-by-default) to override what is
returned byxonsh.platform.bash_command
. - Added
PATH.prepend(path)
to add path to the beginning.
Changed:
- Xonsh AppImage now on Python 3.12 that works faster.
- Xonsh AppImage: pinned prompt-toolkit version until fix upstream issue.
- Builtin aliases (xontrib, history) switched to threadable mode.
- EnvPath methods (append, remove, add, insert) prepare the path before action.
- Replaced black formatter with
ruff-format <https://docs.astral.sh/ruff/>
_ source_foreign_fn
now does not run subshells in interactive mode, so
associated RC files likezshrc
andbashrc
will not be auto-loaded on
sourcing.
Removed:
- Removed
ArgParserAlias.hook_pre_add_argument
,ArgParserAlias.hook_post_add_argument
.
Please use custom action instead to modify the argument options. - Removed deprecated module
xonsh.proc
- Removed usage of deprecated
cgi
module
Fixed:
- Fixed an issue with completions when using absolute paths to commands and having $UPDATE_COMPLETIONS_ON_KEYPRESS set to True. #5127
- Jobs: fixed "index out of range" exception.
- Expressions like
2>1
are now parsed correctly as Python code instead of being treated like special io-redirection operators. - Redirect tokens in quotes (e.g. ">", "2>", "2>1") are now correctly passed to commands as regular arguments.
- Fixed NotADirectoryError during load dircolors.
- Fixed a bug that caused
xonfig web
to overwrite its own configuration file. See #5297 - If an error is encountered while loading the xonshrc file, the traceback is now output as plain text rather than as a list of Tokens
Authors:
- Gil Forsyth
- Noortheen Raja
- anki-code
- Peter Ye
- l-no
xonsh.AppImage excluded from this release because of #5364.