Python-powered, cross-platform, Unix-gazing shell.
OTHER License
Bot releases are hidden (Show)
Published by daniel-shimon about 3 years ago
Fixed pip install
issue in 0.10.0
!
Fixed:
execx
and xonsh -c
previously exposed xonsh-internal code in global scope. They also did not support defining variables and then referring to them in comprehensions, generators, functions, or lambdas. - https://github.com/xonsh/xonsh/issues/4363
register_custom_style()
(#4339)Authors:
Published by daniel-shimon about 3 years ago
Notably the completion system was completely rewritten making it much more robust and flexible!
Also ctrl-Z should work by default and interactive commands won't be threaded.
--use-deprecated=legacy-resolver
.Added:
Added ability to set XONSH_HISTORY_FILE before loading the history backend.
Added ability to get the arguments list in ExecAlias using $args
and $arg<n>
environment variables.
Added instruction how to run xonsh AppImage on Alpine
Xonsh now supports generators as completer functions.
Completion Context - Allow completers to access a parsed representation of the current commandline context.
Added casting CommandPipeline to int, hash and str.
Ability to call the tool by the name from callable alias with the same name without the infinite loop error.
on wsl
field when running xonfig (when linux is detected)
Help and superhelp (obj?
and obj??
) now use the __name__
if available.
added $XONSH_GITSTATUS_FIELDS_TO_HIDE
to hide unwanted fields from {gitstatus}
prompt field.
Added number of lines added and removed to gitstatus
Saving current working directory (cwd) to the history.
Added XONSH_HISTORY_SAVE_CWD environment variable.
Added environment variable $COMPLETE_DOTS
to specify how current and previous directories should be tab completed in cd ('./', '../'):
always
Always complete paths with ./ and ../never
Never complete paths with ./ and ../matching
Complete if path starts with . or ..Complete import
keyword in from ... import
statements.
Enabled case-insensitive completions for the jedi
xontrib.
Non-exclusive completers that enable aggregating multiple completer results.
New $XONSH_CAPTURE_ALWAYS
variable for opt-in interactive capturing.
Since this capturing breaks background jobs and some interactive programs (like git
invoking an editor),
This behavior is now opt-in using this variable.
See https://github.com/xonsh/xonsh/pull/4283 and linked issues.
Wrap selection with quote/parens when $XONSH_AUTOPAIR=True
.
Now xonsh will work with Python 3.10. (Match statement is not supported).
In addition to reading single rc files at startup (/etc/xonshrc
, ~/.config/xonsh/rc.xsh
),
xonsh now also supports rc.d-style config directories, from which all files are sourced. This is
designed to support drop-in style configuration where you could, for example, have a common config
file shared across multiple machines and a separate machine specific file.
This is controlled by the environment variable XONSHRC_DIR
, which defaults to
["/etc/xonsh/rc.d", "~/.config/xonsh/rc.d"]
. If those directories exist, then any xsh
files
contained within are sorted and then sourced.
Added xontrib-prompt-starship - Starship prompt in xonsh shell.
Added XONSH_SUBPROC_CAPTURED_PRINT_STDERR (default False) environment variable to hide unwanted printing the stderr when using captured object.
A $XONSH_TRACE_COMPLETIONS
variable for completions debugging.
Added warning about prompt-toolkit in the welcome message.
Added history backend name to the xonfig.
xontrib-linuxbrew <https://github.com/eugenesvk/xontrib-linuxbrew>
_ to add Homebrew's shell environment to xonsh shell on Linux
Added xontrib-macro-lib - the library of the useful macros for the xonsh shell: https://github.com/anki-code/xontrib-macro-lib
Changed:
jedi
.which
output for non-simple aliasesand/or
, &&/||/|
and environment variables are now non-exclusive.$XONSH_COPY_ON_DELETE
).XONSH_DEBUG
and XONSH_NO_AMALGAMATE
. Setting XONSH_DEBUG=1
now acts like XONSH_DEBUG=2
before (basic information like input transformation, command replacement) and XONSH_DEBUG=2
like XONSH_DEBUG=1
before (more debugging information presented, like PLY parsing messages).shell_type
completer add
command after the non-exclusive completers.Fixed:
x: int = 42
, x: int
).xonsh -c '$("")'
buffer.text
. See https://github.com/xonsh/xonsh/issues/3642#issuecomment-793789741
skip
completer (completes sudo
, which
and other commands).import
completions always work.Authors:
Published by gforsyth over 3 years ago
Added:
Changed:
Fixed:
Authors:
Published by gforsyth over 3 years ago
Added:
tcg
Fixed:
isatty
to wrapped io stream.Authors:
Published by gforsyth over 3 years ago
Added:
VC_GIT_INCLUDE_UNTRACKED environment variable if untracked file changes are desired to show a dirty working directory
added xontrib-powerline2 <https://github.com/vaaaaanquish/xontrib-powerline2>
_
Add '|
' and '|=
' operators to the Aliases
class.
Add tests to the merging functionality.
Add "back2dir" xontrib (https://github.com/anki-code/xontrib-back2dir) - back to the latest used directory when starting xonsh shell.
show code-coverage for PRs
Added CommandPipeline.raw_out
and CommandPipeline.raw_err
to get stdout/err as raw bytes.
The @()
operator now supports bytes
objects.
index for history's sqlite-DB
support passing style from RichCompleter to PTK's Completer
xonsh.cli_utils
to create cli from functions easily.
Python API for completer command with xonsh.completer
module functions.
Added new environment variable $PROMPT_TOKENS_FORMATTER
.
That can be used to set a callable that receives all tokens in the prompt template.
It gives option to format the prompt with different prefix based on other tokens values.
Enables users to implement something like powerline
without resorting to separate $PROMPT_FIELDS. Works with ASYNC_PROMPT
as well.
Check the PR <https://github.com/xonsh/xonsh/pull/3922>
_ for a snippet implementing powerline
PTK style rules can be defined in custom styles using the Token.PTK
token prefix.
For example custom_style["Token.PTK.CompletionMenu.Completion.Current"] = "bg:#ff0000 #fff"
sets the completion-menu.completion.current
PTK style to white on red.
Added new environment variable XONSH_STYLE_OVERRIDES
. It's a dictionary containing pygments/ptk style definitions that overrides the styles defined by XONSH_COLOR_STYLE
.
For example::
$XONSH_STYLE_OVERRIDES["Token.Literal.String.Single"] = "#00ff00" # green 'strings' (pygments)
$XONSH_STYLE_OVERRIDES["completion-menu"] = "bg:#ffff00 #000" # black on yellow completion (ptk)
$XONSH_STYLE_OVERRIDES["Token.PTK.CompletionMenu.Completion.Current"] = "bg:#ff0000 #fff" # current completion is white on red (ptk via pygments)
support PTK's clipboard integration if pyperclip is installed.
So that some common emacs like
cut/copy <https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/examples/prompts/system-clipboard-integration.py>
_
will work out of the box.
Added Python 3.9 to continuous integration.
open in google cloud shell
button 🤩
Respect ignorespace present in $HISTCONTROL
_get_normalized_pstring_quote
returns a consistent set of prefixes, and the quote, for all path-string variants e.g. inputs pr'
and rp'
both produce the tuple ("pr", "'")
. This function is used by xonsh.completers.complete_path
and xonsh.completers._path_from_partial_string
.
Added warning about huge amount of commands in CommandsCache that could affect on start speed.
New xonsh.procs
subpackage for handling subprocess mode.
Environment variable $COMPLETION_MODE
controls kind of TAB completion used with prompt-toolkit shell.
default
, the default, retains prior Xonsh behavior: first TAB displays the common prefix of matching completions,
next TAB selects the first or next available completion.
menu-complete
enables TAB behavior like readline
command menu-complete
. First TAB selects the first matching
completion, subsequent TABs cycle through available completions till the last one. Next TAB after that displays
the common prefix, then the cycle repeats.
Added timing probes for prompt tokens, lexer and before prompt.
improve github actions by adding cache
xog
xontrib - a simple command to establish and print temporary traceback
log file.
Added xontribs
section to the xonfig
.
added xontrib-avox-poetry(http://github.com/jnoortheen/xontrib-avox-poetry)
added xontrib-broot(http://github.com/jnoortheen/xontrib-broot)
added xontrib-long-cmd-durations <https://github.com/jnoortheen/xontrib-cmd-durations>
_
added xontrib-commands <https://github.com/jnoortheen/xontrib-commands>
_
added xontrib-powerline3(http://github.com/jnoortheen/xontrib-powerline3)
Added xontrib-zoxide
to the list of xontribs.
Added xontrib-gitinfo
to the list of xontribs.
Changed:
CommandPipeline.__repr__
now returns formatted output wherein its printed!()
.ujson
(if installed) in LazyJSON to loading json history 15% faster.p
, rp
and pr
prefix from partial p-string used in xonsh.completers._path_from_partial_string
, such that ast.literal_eval
does not raise SyntaxError
. pr
and rp
strings are now treated internally as raw strings, but the p-string quote is correctly returned.xonsh.completers.complete_path
is a p-string. This preserves the length of the prefix for path-string variants.ulimit
builtin now operates on "soft" limits by default.xontribs_meta.py
instead of xontribs.json
Deprecated:
PTK_STYLE_OVERRIDES
has been deprecated, its function replaced by XONSH_STYLE_OVERRIDES
xonsh.proc
module has been deprecated. Please use the newxonsh.procs
subpackage instead. Deprecation warnings related to thisRemoved:
foreground
decorator has been removed.unthreadable
instead.xonsh.proc.unthreadable
and xonsh.proc.uncapturable
xonsh.tools
. Please import fromFixed:
Now the directory and the symlink to this directory will be read from PATH once. Increasing the startup speed on Linux.
Environment variable registration no longer fails to validate when the default
is a callable.
Default values created from callables are stored on in the evironment.
Completers also recognize :
as a valid split point for insertion for, e.g. pytest completions
.. code
pytest test_worker::
Colorize and
/or
operators correctly like &&
/||
Speed of CommandsCache increased when aliases have multiple updates (i.e. init conda).
Now when loading RC files, xonsh will not fail to import modules located on
the same folder.
Setting an alias with IO redirections (e.g ls | wc
) now works correctly.
PTK shell: window has no childres
error while completion is triggered - https://github.com/xonsh/xonsh/issues/3963
make_xontrib - typerror - https://github.com/xonsh/xonsh/issues/3971
Fix libc detection on FreeBSD
Fix uptime functionality on FreeBSD
Updated History Backend tutorial.
enabled flake8 warning on ambiguous names. it is fun naming variables in coded words until oneday it looks like encrypted.
Added ANSI fallback for xonsh.tools.print_color
if shell is not yet initialized. Fixes #3840.
./run-tests.xsh
without arguments previously gave an esoteric error. It
now prints help on how to run the tests.
The git customisation example in the .xonshrc docs uses the right module name
Authors:
Published by scopatz about 4 years ago
Added:
xonsh.pyghooks.register_custom_style
Changed:
COMPLETIONS_CONFIRM
is True
by default.xonsh.AppImage
python version pinned to 3.8.Removed:
import random
.Fixed:
NO_COLOR
to RESET
change.xontrib list
.Authors:
Published by scopatz about 4 years ago
Added:
$PROMPT
, setting $TITLE
for example. (#374, #1403)$ENABLE_ASYNC_PROMPT=True
.unset
, export
, set -e
, set -x
, shopt
, complete
to xontrib bashisms.exit(exit_code)
function by default in not interactive mode. Now importing exit
from sys
is not needed.DEFAULT
that is used to designate the terminal's default color.RESET
used to reset all attributes.xontrib-onepath <https://github.com/anki-code/xontrib-onepath>
_ to associate files with apps in xonsh shell like in graphical OS.print_color
and printx
functions to builtins as reference to xonsh.tools.print_color
.xonfig jupyter-kernel
new subcommand to generate xonsh kernel spec for jupyter.powerline-binding
(https://github.com/dyuri/xontrib-powerline-binding) - uses powerline
to render the prompt.Changed:
--shell-type
argument in help message.path
type in ${...}.register
was renamed to env_path
as it should be and addedpath
type instead that represent pathlib.Path
. Now you can register typed environmentPath
.DEFAULT_VARS
or via env.register()
),DefaultNotGiven
, then variable has no default and raises KeyError
if it is not"var" in __xonsh__.env
will return False.DefaultNotGiven
, so code can rationally test whetherNO_COLOR
to RESET
.$GIT_OPTIONAL_LOCKS=0
. For details on what this entails seeGIT_OPTIONAL_LOCKS <https://git-scm.com/docs/git#Documentation/git.txt-codeGITOPTIONALLOCKScode/>
_.menu-complete
.xonfig info
displays whether jupyter detected in environment andDeprecated:
NO_COLOR
color reset token in favor of RESET
.Removed:
--config-path
argument suppressed from help.xonfig jupyter-kernel
manually.Fixed:
*DIRS
environment variables.python setup.py install
worked, butpip install .
wouldn't (because pip mucks with sys.path
),setup.py
).xonfig info
now displays actual value of ON_MSYS and ON_CYGWIN instead of lazy bool type.Authors:
Published by scopatz about 4 years ago
Added:
tools.debian_command_not_found()
function for finding commands intools.conda_suggest_command_not_found()
function for finding commands in$FOO="bar" bash -c r"echo $FOO"
).Changed:
command_not_found()
is now a wrapper function that finds packages for missingenv
argumentFixed:
xonfig wizard
AttributeError: '_MergedKeyBindings' object has no attribute 'add'
Authors:
Published by scopatz about 4 years ago
Added:
xonsh-in-docker.py
script now has --pytest
parameter,pip install xonsh[full]
.return x, *my_list
).vox
xontrib now supports new --activate
and deactivate --remove
Changed:
Fixed:
Authors:
Published by scopatz about 4 years ago
Added:
abbrevs
expansion now allows for setting cursor to a specific
position within the expanded abbrev. For instance
::
abbrevs["eswap"] = "with ${...}.swap():\n "
expands eswap
as you type to environment context manager
swap()
syntax and places the cursor at the position of the
<edit>
mark removing the mark itself in the process.
Support for ANSI escape codes in $PROMPT
/$RIGHT_PROMPT
. In this way 3rd party prompt generators like powerline
or starship
can be used to set the prompt. ANSI escape codes might be mixed with the normal formatting (like {BOLD_GREEN}
) and prompt variables (like {user}
) should work as well.
For example:
::
$PROMPT=lambda: $(starship prompt)
$RIGHT_PROMPT="\x1b[33m{hostname} {GREEN}> "
Added $HOSTNAME
and $HOSTTYPE
environment variables.
New Env.rawkeys()
iterator for iterating over all keys in an environment,
not just the string keys like with __iter__()
.
New landing page for https://xon.sh
Added xonsh AppImage to the GitHub release assets
xonsh now comes with a bulitin version of prompt-toolkit (3.0.5) which will be used as fall back if prompt_toolkit is not installed.
Support for Python 3.8 PEP 572 assignment expressions (walrus operator).
Changed:
Fixed:
Iterating over ${...}
or __xonsh__.env
yields only string
values again.
List comprehensions do not ignore the second and subsequent if
clauses
in multi-if comprehension expressions any more.
Xonsh can now fully handle special Xonsh syntax within f-strings, including
environmnent variables within ${}
operator and captured subprocess
expansion within f-string expressions.
Avoid startup error on Windows when py.exe chooses wrong python interpreter to run xonsh.
When multiple interpreters are in PATH, 'py' will choose the first one (usually in the virtual environment),
but 'py -3' finds the system-wide one, apparently by design.
For xonsh-cat, avoid parsing and processing first (0'th) argument when invoked directly from OS shell.
Run control files are now read in with $THREAD_SUBPROCS
off.
This prevents a weird error when starting xonsh from Bash (and
possibly other shells) where the top-level xonsh process would
be stopped and placed into the background during startup. It
may be necessary to set $THREAD_SUBPROCS=False
in downstream
xonsh scripts and modules.
Fixed installation issues where generated files (like the parser table and
amalgamated modules) were not installed.
The xonsh test suite has been cleaned up. So no more failing test. Hopefully.
Addressed robustness issue with "locked"
history key not
being present at startup.
vox
xontrib works again with the new environment defaults.
Authors:
Published by scopatz about 4 years ago
Added:
history
command now supports flush
action
Added new items on "Bash to xsh" page
JsonHistory: added history gc --force
switch to allow user to override above warning.
JsonHistoryGC: display following warning when garbage collection would delete "too" much data and don't delete anything.
"Warning: History garbage collection would discard more history ({size_over} {units}) than it would keep ({limit_size}).\n"
"Not removing any history for now. Either increase your limit ($XONSH_HIST_SIZE), or run history gc --force
.",
It is displayed when the amount of history on disk is more than double the limit configured (or defaulted) for $XONSH_HIST_SIZE.
$LS_COLORS code 'mh' now recognized for (multi) hard-linked files.
$LS_COLORS code 'ca' now recognized for files with security capabilities (linux only).
CI step to run flake8 after pytest.
RichCompletion for completions with different display value, description and prefix_len.
Allow completer access to multiline document when available via xonsh.completers.tools.get_ptk_completer().current_document
.
abbrevs
word expasion can now be reverted by pressing
the space bar second time immediately after the previous
word got expanded.
ulimit
command.
pdb
xontrib, that runs pdb debugger on reception of SIGUSR1 signal.
xontrib-xpg is a xontrib for running or explaining sql queries for posgresql database.
Changed:
argv[0]
argument containingtests\test_integrations.py
no longer runs with XONSH_DEBUG=1 (because new, debug-only progress messages from history were breaking it).pyupgrade --py36-plus
, in order to automatically update to newerxontrib load
does not stop loading modules on error any more.Deprecated:
pytest --flake8
now exits with error message to use flake8 instead.Removed:
getouterframes
anymore, useinspect.getouterframe
directly.Fixed:
Unhandled exception triggered by unexpected return from callable alias.
Fix path completer throwing exception sometimes
Fixed help operator not displaying definition for callables.
JsonHistory.files(): Now once again enumerates history files from the directory. This has been broken for about 2 years.
JsonHistory.run_gc(): Don't busy loop while waiting for history garbage collection to complete, sleep a bit instead.
This does much to keep Xonsh ptk_shell responsive when dealing with very large history on disk.
Fixed JSON history indexing error.
Fixed syntax error in scripts containing line continuation syntax.
$LS_COLORS code 'fi' now used for "regular files", as it should have been all along. (was 'rs')
See (#3608)[https://github.com/xonsh/xonsh/issues/3608].
pyghooks.color_files now follows implememntation of ls --color closely. Thanks @qwenger!
However, a few documented differences remain due to use in Xonsh.
$LS_COLORS['ln'] = 'target' now works. Also fixes #3578.
Fixed exit code for commands executed via -c
(#3402)
Logical subprocess operators now work after long arguments (e.g. --version
).
pip
completer no longer erroneously fires for pipx
Updated development guide to reference flake8 instead of pylint
Corrected flake8 config for allowed exceptions.
various pytest warnings in a "clean" test run.
The current Mercurial topic is shown.
Fixed import problems due to modules using deprecated pkg_resources methods by proxying calls to the underlying loader.
Typo in 'source' alias.
Crash in 'completer' completer.
Don't complete unnecessarily in 'base' completer
Viewing mock objects in the shell
Fixed formatting error in vox rm
command.
Authors:
Published by gforsyth over 4 years ago
Added:
xontrib-output-search <https://github.com/anki-code/xontrib-output-search>
_ to get identifiers, names, paths, URLs and words from the previous command output and use them for the next command.xontrib-pipeliner <https://github.com/anki-code/xontrib-pipeliner>
_ is to easily process the lines using pipes.xontrib-prompt-bar <https://github.com/anki-code/xontrib-prompt-bar>
_ with elegance bar style for prompt.Changed:
Deprecated:
Removed:
Fixed:
Authors:
Published by scopatz over 4 years ago
Changed:
@$()
subprocess operator now properly strips newline characters off
the lines of multiline output.
@$()
subprocess operator does not require leading and trailing whitespace
anymore, so expansions like cd /lib/modules/@$(uname -r)/kernel
or
gdb --pid=@$(pidof crashme)
are now possible.
Moved most CI to github actions (OSX is still on travis)
Replaced Repl.It with RunThis on the front page of the docs.
Fixed:
"&"
as the last argument in subprocess mode.FileNotFoundError
exception if pathAuthors:
Published by gforsyth over 4 years ago
Added:
abbrevs
xontrib.xontrib-pyenv <https://github.com/dyuri/xontrib-pyenv>
_ to list of registered xontribs.Changed:
xdg-open
now runs unthreaded.Fixed:
os.path.isdir()
os.scandir()
does.Authors:
Published by scopatz over 4 years ago
Added:
$XONSH_TRACE_SUBPROC
environment variable.-l
, -c
and -a
options to xexec
, works now like exec
Changed:
-l
switch works like bash, loads environment in non-interactive shelltest_*.xsh
Fixed:
execx
does not require the input string to be newline-terminated.evalx
accepts newline-terminated input string.Authors:
Published by scopatz over 4 years ago
Added:
xonsh/interactive
container has been added, in addition to the previous xonsh/xonsh
and xonsh/action
containers. See https://hub.docker.com/u/xonsh
$THREAD_SUBPROCS
environment variable allows you toTrue
.umask
utility to view or set the file creation maskxonfig web
command that launches a web UI (in your browser) that$XONSH_COLOR_STYLE
, $PROMPT
, and~/.xonshrc
file on a new system or for new users. It supersedes thexonfig wizard
command.xonsh.webconfig
subpackage for creating and launching xonfig web
.localtime
entry to the $PROMPT_FIELDS
dictionary, allowing userstime_format
entry of $PROMPT_FIELDS
, which defaults to "%H:%M:%S"
.xonsh.prompt.times
module.html
module in xonsh.lazyimps
was added to lazily importpygments.formatters.html
.xonsh.pyghooks.XonshHtmlFormatter
class that enables HTML formatting ofChanged:
xonsh.pyghooks.XonshLexer
now inherits from Python3Lexer
,PythonLexer
.xonsh.pyghooks.XonshStyle
now presents the highlight_color
andbackground_color
from the underlying style correctly.Removed:
xonda
xontrib
from listFixed:
[color] in .gitconfig (#3427) <https://github.com/xonsh/xonsh/issues/3427>
_ now stripped from {curr_branch}
Before <https://i.imgur.com/EMhPdgU.png>
_
After <https://i.imgur.com/sJiqgsb.png>
_
Ctrl+Z
no longer deadlocks the terminal,XonshImportHook.get_source()
now takes a dotted module name instead of a file path, as it should$PROMPT_REFRESH_INTERVAL
.rm
commanddel
instead.Authors:
Published by scopatz about 5 years ago
Changed:
$LS_COLORS
environment variable will no longer raise exceptions when tryingRemoved:
Windows terminal <https://github.com/microsoft/terminal>
__.Fixed:
Fixed issue converting ANSI color codes that contained both slow blink and set foreground
or set background sequences.
Fix coreutils cat
behaviour on empty input (e.g. cat -
).
Fix Ctrl-C event causing Atribute error on Windows.
Fix Added OpenBSD as a platform
Fix Corrected aliases for OpenBSD to not include --color=auto
and -v
Fixed a regession with xonsh superhelp ??
operator and which -v
which showed Pythons builtin
doc strings.
Authors:
Published by scopatz about 5 years ago
Added:
autovox
xontribxonsh.lib.itertools.as_iterable
for making sure that strings are turned into iterablespercol
command no longer predicts as threadable.Changed:
source
alias is now unthreaded, enabling contextvars
to be usedExecAlias
to only be applied when the logical operatorsand
, or
) are surrounded by whitespace.Fixed:
$LS_COLORS
.xonsh.lib.subprocess.check_output()
now properly captures output.CTRL_C_EVENT
to subprocesses instead of SIGINT
.xonsh
will return a non-zero exit code if it is run in file mode and$ xonsh thisfiledoesntexist.xsh
xonsh: thisfiledoesntexist.xsh: No such file or directory.
$ _.returncode
1
Authors:
Published by scopatz about 5 years ago
Changed:
vox activate
will now prepend the absolute path of the virtualenv bin/
directory (or Scripts/
on Windows) to $PATH
; before this was a relative path.Fixed:
endidx
in completer tutorialaliases['echocat'] = 'echo "hi" and echo "there"'
will, when run, returnhi
there
Authors:
Published by scopatz about 5 years ago
Added:
Fixed:
cat
can't read pseudo files with zero size such as /proc/* or /sys/* (#3182, #3199)'target'
psuedo-color in $LS_COLORS
for link coloring basedAuthors: