Python-powered, cross-platform, Unix-gazing shell.
OTHER License
Bot releases are hidden (Show)
Published by scopatz almost 6 years ago
Changed:
string.Formatter()
in thexonsh.tools.FORMATTER
.Fixed:
f"{expr}"
) are now fully capable of executing xonsh expressions.![cmd]
and !(cmd)
don't work because!
character interferes with Python string formatting. If you need to$[cmd]
and $(cmd)
instead.Published by scopatz about 6 years ago
Added:
SubprocSpec
has a new pipeline_index
integer attribute that indicates
the commands position in a pipeline. For example, in
.. code-block:: sh
p = ![ls -l | grep x]
The ls
command would have a pipeline index of 0
(p.specs[0].pipeline_index == 0
) and grep
would have a pipeline index
of 1 (p.specs[1].pipeline_index == 1
). This may be usefule in callable
alaises which recieve the spec as an argument.
Changed:
fish
from list of supported foreign shells in the wizard.black
(18.9b0)xonsh.main.setup()
to setup test environment.platform.linux_distribution()
Fixed:
Published by scopatz about 6 years ago
Added:
Windows CI jobs on Azure Pipelines
The cryptop
command will no longer have its output captured
by default.
Added new env-var PTK_STYLE_OVERRIDES
. The variable is
a dictionary containing custom prompt_toolkit style definitions.
For instance::
$PTK_STYLE_OVERRIDES['completion-menu'] = 'bg:#333333 #EEEEEE'
will provide for more visually pleasing completion menu style whereas::
$PTK_STYLE_OVERRIDES['bottom-toolbar'] = 'noreverse'
will prevent prompt_toolkit from inverting the bottom toolbar colors
(useful for powerline extension users)
Note: This only works with prompt_toolkit 2 prompter.
Changed:
__xonsh_*__
builtins have been migrated to a XonshSession
instance at__xonsh__
. E.g. __xonsh_env__
is now __xonsh__.env
.XonshError
) have been proxied to__xonsh__
session object as well.Deprecated:
__xonsh_*__
builtins are deprected. Instead, the corresponding__xonsh__.*
accessor should be used. The existing __xonsh_*__
accessorsFixed:
Fixed deprecation warnings from unallowed escape sequences as well as importing abstract base classes directly from collections
Fix for string index error in stripped prefix
bash_completions to include special characters in lprefix
Previously, glob expansion characters would not be included in lprefix for replacement
.. code-block:: sh
$ touch /tmp/abc
$ python
from bash_completion import bash_completions
def get_completions(line):
... split = line.split()
... if len(split) > 1 and not line.endswith(' '):
... prefix = split[-1]
... begidx = len(line.rsplit(prefix)[0])
... else:
... prefix = ''
... begidx = len(line)
... endidx = len(line)
... return bash_completions(prefix, line, begidx, endidx)
...
get_completions('ls /tmp/a*')
({'/tmp/abc '}, 0)
Now, lprefix begins at the first special character:
.. code-block:: sh
$ python
from bash_completion import bash_completions
def get_completions(line):
... split = line.split()
... if len(split) > 1 and not line.endswith(' '):
... prefix = split[-1]
... begidx = len(line.rsplit(prefix)[0])
... else:
... prefix = ''
... begidx = len(line)
... endidx = len(line)
... return bash_completions(prefix, line, begidx, endidx)
...
get_completions('ls /tmp/a*')
({'/tmp/abc '}, 7)
The xonsh.main.setup()
function now correctly passes the
shell_type
argument to the shell instance.
try_subproc_toks now works for subprocs with trailing and leading whitespace
Previously, non-greedy wrapping of commands would fail if they had leading and trailing whitespace:
.. code-block:: sh
$ true && false || echo a
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
NameError: name 'false' is not defined
$ echo; echo && echo a
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
NameError: name 'echo' is not defined
Now, the commands are parsed as expected:
.. code-block:: sh
$ true && false || echo a
a
$ echo; echo && echo a
a
Published by scopatz about 6 years ago
Added:
f"{$HOME}"
will yield "/home/user"
. Note that this willdetype()
-ed version of the environment variable,Changed:
aurman
command will now be predicted to be unthreaded by default.Fixed:
xonfig wizard
would crash if an unknown foreign shell washg split
command will now predict as unthreadable.Published by scopatz about 6 years ago
Added:
The python-mode @(expr)
syntax may now be used inside of subprocess
arguments, not just as a stand-alone argument. For example:
.. code-block:: sh
$ x = 'hello'
$ echo /path/to/@(x)
/path/to/hello
This syntax will even properly expand to the outer product if the expr
is a list (or other non-string iterable) of values:
.. code-block:: sh
$ echo /path/to/@(['hello', 'world'])
/path/to/hello /path/to/world
$ echo @(['a', 'b']):@('x', 'y')
a:x a:y b:x b:y
Previously this was not possible.
New $DOTGLOB
environment variable enables globs to match
"hidden" files which start with a literal .
. Set this
variable to True
to get this matching behavior.
Cooresponding API changes have been made to
xonsh.tools.globpath()
and xonsh.tools.iglobpath()
New environment variable $FOREIGN_ALIASES_SUPPRESS_SKIP_MESSAGE
enables the removal of skipping foreign alias messages.
New --suppress-skip-message
command line option for skipping
foreign alias messages when sourcing foreign shells.
Fixed:
set()
willPublished by scopatz about 6 years ago
Added:
xonsh.lib.collections.ChainDB
, a chain map which merges mergable fieldsFixed:
Published by scopatz about 6 years ago
Added:
XONSH_HISTORY_MATCH_ANYWHERE
. If set to True
thenFalse
Changed:
Fixed:
Fix for Enter
not returning from Control-R search buffer
Fixed automatic wrapping of many subprocesses that spanned multiple lines via
line continuation characters with logical operators separating the commands.
For example, the following now works:
.. code-block:: sh
echo 'a' \
and echo 'b'
Environment swapping would not properly reraise errors due to weird
Python name binding issue.
Published by scopatz about 6 years ago
Added:
stack
argument. If they do, then theFrameInfo
objects (as detailed in the standard library inspect
stack
parameter is None
.SubprocSpec
now has a stack
attribute, for passing the call stackNone
if the spec does notresolve_stack()
method computes the stack
Changed:
Fixed:
AssertionError: wrong color format
) on Python 3.5 and prompt_toolkit 1.completer
command now correctly finds completion functions$XONSH_STDERR_PREFIX/POSTFIX
withPublished by scopatz about 6 years ago
Fixed:
Published by scopatz about 6 years ago
Added:
xonsh-cat
command line utility, which is a xonsh replacementcat
command.xonsh.xoreutils.cat.cat_main()
enables the xonsh.xoreutils.cat
CommandsCache.is_only_functional_alias()
andCommandsCache.lazy_is_only_functional_alias()
methods for determining ifxonsh.xontribs.xontribs_load()
is a new first-class API for loading$COMPLETIONS_DISPLAY
now supports readline-like behavior onChanged:
git log
, man
, less
and other paged commands to the client.$PAGER = 'cat'
. If cat
is not availablexonsh-cat
is used instead.setup()
function for starting up a working xonsh has aliases
,xontribs
, and threadable_predictors
as new additional keywordFixed:
CommandsCache.locate_binary()
will now properly return None whenignore_alias=False
and the command is only a functional alias,cd
. Previously, it would return the name of the$COMPLETIONS_DISPLAY
raising an error onmulti
.vox list
Published by scopatz about 6 years ago
Added:
PROMPT_TOOLKIT_COLOR_DEPTH
environment to xonsh default environment.DEPTH_1_BIT
/MONOCHROME
,DEPTH_4_BIT
/ANSI_COLORS_ONLY
, DEPTH_8_BIT
/DEFAULT
, or DEPTH_24_BIT
/TRUE_COLOR
.$INTENSIFY_COLORS_ON_WIN
JupyterShell
for interactive interfacing with Jupyter.Changed:
ansicyan
/ansibrightcyan
vs. the old #ansiteal
/#ansiturquoise
). The names are automaticallyRemoved:
Fixed:
Published by scopatz about 6 years ago
Added:
history show
builtin now supports optional -0
parameter that switchesFixed:
Published by scopatz about 6 years ago
Added:
xonsh.lib.os.rmtree()
an rmtree which works on windows properly (even withChanged:
$AUTO_SUGGEST_IN_COMPLETIONS=False
pygments_cache.get_all_styles()
function instead ofFixed:
Fixed issue with $ARG<N>
varaibles not being passed to subprocesses correctly.
Fixed issue with multiline string inside of @(expr)
in
unwrapped subprocesses. For example, the following now works::
echo @("""hello
mom""")
CommandPipeline.output
now does properly lazy, non-blocking creation of
output string. CommandPipeline.out
remains blocking.
Fix regression in INTENSIFY_COLORS_ON_WIN
functionality due to prompt_toolkit 2 update.
Fixed issue that can't insert quotation marks and double quotes
for completion.
Fixed issue with SyntaxErrors
being reported on the wrong line
when a block of code contained multiple implicit subprocesses.
prompt_toolkit >= 2
will start up even if Pygments isn't presentxonfig styles
reporting AttributeError: module 'pygments' has no attribute 'styles'
Published by scopatz over 6 years ago
Added:
prompt_toolkit 2.0
--shell-type
($SHELL_TYPE
) may now be specified usingrl
for readline
and ptk2
forprompt_toolkit2
. See xonsh --help
for a full listingFixed:
Published by scopatz over 6 years ago
Added:
xonsh.lib.subprocess.check_output
as a check_output
drop inFixed:
xonsh.lib.subprocess.run
doesn't change dirs unless askedPublished by scopatz over 6 years ago
Added:
xonsh.lib
subpackagexonsh.lib.os.indir
a context manager for temporarily entering into a directoryxonsh.lib.subprocess.run
and xonsh.lib.subprocess.check_call
xonsh
as the backendFixed:
Published by scopatz over 6 years ago
Fixed:
CDPATH
only trigger when used with cd
ctypes.util
is now explictly performed, as needed.ctypes
.pkg_resources
that has been removed.pip
completerbash_completion
no longer returns invalid prefix lengths for directoriesPublished by scopatz over 6 years ago
Changed:
Fixed:
$RAISE_SUBPROC_ERROR = True
.xonsh.tokenize.tok_name
no longer mutates the standard library tokenize.tok_name
.Published by scopatz over 6 years ago
Added:
A multipurpose add method to EnvPath. For example:
.. code-block:: xonshcon
$ $PATH
EnvPath(
['/usr/bin', '/usr/local/bin', '/bin']
)
$ $PATH.add('~/.local/bin', front=True); $PATH
EnvPath(
['/home/user/.local/bin', '/usr/bin', '/usr/local/bin', '/bin']
)
$ $PATH.add('/usr/bin', front=True, replace=True); $PATH
EnvPath(
['/usr/bin', '/home/user/.local/bin', '/usr/local/bin', '/bin']
)
Added pygments-cache
project in order to reduce startup time.
Changed:
hg
) will no longer run in a threadable subprocess whenFixed:
Published by scopatz over 6 years ago
Added:
FileInsterter
node class now has dumps()
method forFixed:
xonfig wizard
writer failing to write valid run control$XONSH_HISTORY_SIZE
has been fixed.