xonsh v0.5.0 Release Notes
-
โ Added:
- $XONTRIB_MPL_MINIMAL environment variable can be set to change if plots are minimalist or as-seen
- ๐ฆ xontrib-mpl now supports iTerm2 inline image display if iterm2_tools python package is installed
- Xonsh now will fallback to other shells if encountered errors when starting up.
- โ Added entry to customization faq re:
dirs
alias (#1452) - โ Added entry to customization faq re: tab completion selection (#1725)
- โ Added entry to customization faq re: libgcc core dump (#1160)
- Section about quoting in the tutorial.
- The
$VC_HG_SHOW_BRANCH
environment variable to control whether to hide the hg branch in the prompt. - โ xonfig now contains the latest git commit date if xonsh installed from source.
- Alt+Enter will execute a multiline code block irrespective of cursor position
- ๐ Windows now has the ability to read output asynchronously from the console.
- ๐ Use
doctr <https://drdoctr.github.io/doctr/>
_ to deploy dev docs to github pages - ๐ New
xonsh.proc.uncapturable()
decorator for declaring that function aliases should not be run in a captured subprocess. - ๐ New history backend sqlite.
- ๐ฆ Prompt user to install xontrib package if they try to load an uninstalled xontrib
- Callable aliases may now take a final
spec
argument, which is the correspondingSubprocSpec
instance. - ๐ New
bashisms
xontrib provides additional Bash-like syntax, such as!!
. This xontrib only affects the command line, and not xonsh scripts. - โ Tests that create testing repos (git, hg)
- ๐ New subprocess specification class
SubprocSpec
is used for specifying and manipulating subprocess classes prior to execution. - ๐ New
PopenThread
class runs subprocesses on a a separate thread. - ๐ New
CommandPipeline
andHiddenCommandPipeline
classes manage the execution of a pipeline of commands via the execution of the last command in the pipeline. Instances may be iterated and stream lines from the stdout buffer. These pipelines read from the stdout & stderr streams in a non-blocking manner. $XONSH_STORE_STDOUT
is now available on all platforms!- The
CommandsCache
now has the ability to predict whether or not a command must be run in the foreground usingPopen
or may use a background thread and can usePopenThread
. - Callable aliases may now use the full gamut of functions signatures:
f()
,f(args)
,f(args, stdin=None)
,f(args, stdin=None, stdout=None)
, andf(args, stdin=None, stdout=None, stderr=None)
`. - Uncaptured subprocesses now receive a PTY file handle for stdout and stderr.
- New
$XONSH_PROC_FREQUENCY
environment variable that specifies how long loops in the subprocess framework should sleep. This may be adjusted from its default value to improved performance and mitigate "leaky" pipes on slower machines. - ๐
Shift+Tab
moves backwards in completion dropdown in prompt_toolkit - PromptFormatter class that holds all the related prompt methods
- ๐ PromptFormatter caching when building the prompt
- p-strings:
p'/foo/bar'
is short forpathlib.Path('/foo/bar')
- ๐ byte strings: prefixes other than
b'foo'
(eg,RB'foo'
) now work - ๐ Backticks for regex or glob searches now support an additional modifier
p
, which causes them to return Path objects instead of strings. - ๐ New
BOTTOM_TOOLBAR
environment variable to control a bottom toolbar as specified in prompt-toolkit - New
$XONSH_STDERR_PREFIX
and$XONSH_STDERR_POSTFIX
environment variables allow the user to print a prompt-like string before and after all stderr that is seen. For example, say that you would like stderr to appear on a red background, you might set$XONSH_STDERR_PREFIX = "{BACKGROUND_RED}"
and$XONSH_STDERR_PREFIX = "{NO_COLOR}"
. - ๐ New
xonsh.pyghooks.XonshTerminal256Formatter
class patches the pygments formatter to understand xonsh color token semantics. - Load events are now available
- New events added:
on_post_init
,on_pre_cmdloop
,on_pre_rc
,on_post_rc
,on_ptk_create
- Completion for
xonsh
builtin functionsxontrib
andxonfig
- โ Added a general customization FAQ page to the docs to collect various tips/tricks/fixes for common issues/requests
test_single_command
andtest_redirect_out_to_file
tests intest_integrations
- โ Add note that the target of redirection should be separated by a space.
๐ Changed:
- CircleCI now handles flake8 checks
- Travis doesn't allow failures on nightly
get_hg_branch
runshg root
to find root dir and check if we're in repo- ๐ The default style will now use the color keywords (#ansired, #ansidarkred) to set colors that follow the terminal color schemes. Currently, this requires prompt_toolkit master (>1.0.8) and pygments master (2.2) to work correctly.
vox activate
now accepts relative directories.- โก๏ธ Updated the effectivity of
$XONSH_DEBUG
on debug messages. - ๐ Better documentation on how to get nice colors in Windows' default console
- All custom prompt_toolkit key binding filters now declared with the
@Condition
decorator - ๐ The style for the prompt toolkit completion menu is now lightgray/darkgray instead of turquoise/teal
- ๐ landscape.io linting now ignores ply directory
history
help messages to reflect subcommand usage- Quote all paths when completion if any of the paths needs be quoted, so that bash can automatically complete to the max prefix of the paths.
- Tee'd reads now occur in 1kb chunks, rather than character-by-character.
- The
which
alias no longer has a trailing newline if it is captured. This means that$(which cmd)
will simply be the path to the command. 0๏ธโฃ The following commands are, by default, predicted to be not threadable in some circumstances:
- bash
- csh
- clear
- clear.exe
- cls
- cmd
- ex
- fish
- htop
- ksh
- less
- man
- more
- mutt
- nano
- psql
- ranger
- rview
- rvim
- scp
- sh
- ssh
- startx
- sudo
- tcsh
- top
- vi
- view
- vim
- vimpager
- xo
- xonsh
- zsh
The
run_subproc()
function has been replaced with a new implementation.Piping between processes now uses OS pipes.
$XONSH_STORE_STDIN
now usesos.pread()
rather thantee
and a new file.๐ The implementation of the
foreground()
decorator has been moved tounthreadable()
.๐
voxapi.Vox
now supportspathlib.Path
andPathLike
objects as virtual environment identifiersRenamed FORMATTER_DICT to PROMPT_FIELDS
BaseShell instantiates PromptFormatter
readline/ptk shells use PromptFormatter
โก๏ธ Updated the bundled version of
ply
to current master availableโก๏ธ vended
ply
is now a git subtree to help with any future updatesWHITE
color keyword now means lightgray andINTENSE_WHITE
completely whiteRemoved
add_to_shell
doc section from*nix
install pages and instead relocated it to the general customization page๐ง Moved a few
*nix
customization tips from the linux install page to the general customization page
โ Removed:
- coverage checks
- ๐
CompletedCommand
andHiddenCompletedCommand
classes have been removed in favor ofCommandPipeline
andHiddenCommandPipeline
. - ๐
SimpleProcProxy
andSimpleForegroundProcProxy
have been removed in favor of a more general mechanism for dispatching callable aliases implemented in theProcProxyThread
andProcProxy
classes. - โ
test_run_subproc.py
in favor oftest_integrations.py
- โ Unused imports in many tests
- โ Many duplicated tests (copypasta)
๐ Fixed:
- xontrib-mpl now preserves the figure and does not permanently alter it for viewing
- ๐ Fix up small pep8 violations
- ๐ Fixed a bug where some files are not showing using bash completer
- ๐ Fixed some issues with subprocess capturing aliases that it probably shouldn't.
safe_readable()
now checks forValueError
as well.- The scroll bars in the PTK completions menus are back.
- Jupyter kernel installation now respects the setuptools
root
parameter. - Fix
__repr__
and__str__
methods ofSubprocSpec
so they report correctly - ๐ Fixed the message printed when which is unable to find the command.
- ๐ Fixed a handful of sphinx errors and warnings in the docs
- ๐ Fixed many PEP8 violations that had gone unnoticed
- ๐ Fix failure to detect an Anaconda python distribution if the python was install from the conda-forge channel.
- current_branch will try and locate the vc binary once
- May now Crtl-C out of an infinite loop with a subprocess, such as
`
while True: sleep 1
. - ๐ Fix for stdin redirects.
- Backgrounding works with
$XONSH_STORE_STDOUT
PopenThread
blocks its thread from finishing until command has completed or process is suspended.- โ Added a minimum time buffer time for command pipelines to check for if previous commands have executed successfully. This is helpful for pipelines where the last command takes a long time to start up, such as GNU Parallel. This also checks to make sure that output has occurred. This includes piping 2+ commands together and pipelines that end in unthreadable commands.
curr_branch
reports correctly whengit config status.short true
is usedpip
completion now filters results by prefix- ๐ Fixed streaming
!(alias)
repr evaluation where bytes where not streamed. - Aliases that begin with a comma now complete correctly (no spurious comma)
- 0๏ธโฃ Use
python3
in shebang lines for compatibility with distros that still use Python 2 as the default Python - STDOUT is only stored when
$XONSH_STORE_STDOUT=True
- ๐ Fixed issue with alias redirections to files throwing an OSError because the function ProcProxies were not being waited upon.
- ๐ Fixed issue with callable aliases that happen to call sys.exit() or raise SystemExit taking out the whole xonsh process.
- Safely flushes file handles on threaded buffers.
- ๐ Proper default value and documentation for
$BASH_COMPLETIONS
- ๐ Fixed readline completer issues on paths with spaces
- ๐ Fix bug in
argvquote()
functions used when sourcing batch files on Windows. The bug meant an extra backslash was added to UNC paths. Thanks to @bytesemantics for spotting it, and @janschulz for fixing the issue. - pep8, lint and refactor in pytest style of
test_ptk_multiline.py
,test_replay.py
- ๐ Tab completion of aliases returned a upper cased alias on Windows.
- History show all action now also include current session items.
proc.stream_stderr
now handles stderr that doesn't have buffer attribute- Made
history show
result sorted. - ๐ Fixed issue that
history gc
does not delete empty history files. - ๐ Standard stream tees have been fixed to accept the possibility that they may not be backed by a binary buffer. This includes the pipeline stdout tee as well as the shell tees.
- ๐ Fixed a bug when the pygments plugin was used by third party editors etc.
- CPU usage of
PopenThread
andCommandPipeline
has been brought down significantly.