Xonsh

Latest version: v0.16.0

Safety actively analyzes 638452 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 17 of 20

0.5.2

====================

**Added:**

* Added ``weechat`` to default predictors
* ``$DYNAMIC_CWD_ELISION_CHAR`` environment variable to control how a shortened
path is displayed.


**Changed:**

* ``_ret_code`` function of ``prompt_ret_code`` xontrib return now ``None`` when
return code is 0 instead of empty string allowing more customization of prompt
format.


**Fixed:**

* Minor Python completer token counting bug fix.
* multiline syntax error in PTK shell due to buffer not being reset
* Segfaults and other early exit signals are now reported correctly,
again.
* ``tests/bin/{cat,pwd,wc}`` shebang changed to python3

0.5.1

====================

**Fixed:**

* Fixed xonfig raising error when xonsh is not installed from source.

0.5.0

====================

**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
corresponding ``SubprocSpec`` 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`` and ``HiddenCommandPipeline`` 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 using ``Popen`` or may use a
background thread and can use ``PopenThread``.
* Callable aliases may now use the full gamut of functions signatures:
``f()``, ``f(args)``, ``f(args, stdin=None)``,
``f(args, stdin=None, stdout=None)``, and `
``f(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 for ``pathlib.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 functions ``xontrib`` and ``xonfig``
* Added a general customization FAQ page to the docs to collect various
tips/tricks/fixes for common issues/requests
* ``test_single_command`` and ``test_redirect_out_to_file`` tests in ``test_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`` runs ``hg 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.
* 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 uses ``os.pread()`` rather than ``tee`` and a new
file.
* The implementation of the ``foreground()`` decorator has been moved to
``unthreadable()``.
* ``voxapi.Vox`` now supports ``pathlib.Path`` and ``PathLike`` objects as virtual environment identifiers
* Renamed 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 updates
* ``WHITE`` color keyword now means lightgray and ``INTENSE_WHITE`` completely white
* Removed ``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`` and ``HiddenCompletedCommand`` classes have been removed
in favor of ``CommandPipeline`` and ``HiddenCommandPipeline``.
* ``SimpleProcProxy`` and ``SimpleForegroundProcProxy`` have been removed
in favor of a more general mechanism for dispatching callable aliases
implemented in the ``ProcProxyThread`` and ``ProcProxy`` classes.
* ``test_run_subproc.py`` in favor of ``test_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 for ``ValueError`` 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 of ``SubprocSpec`` 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 when ``git config status.short true`` is used
* ``pip`` 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)
* 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`` and ``CommandPipeline`` has been brought
down significantly.

0.4.7

====================

**Added:**

* Define alias for 'echo' on startup for Windows only.
* New coredev `AstraLuma <https://github.com/AstraLuma>`_ added
* ``which -a`` now searches in ``__xonsh_ctx__`` too
* Info about the xontrib cookiecutter template on xontrib tutorial
* xonsh's optional dependencies may now be installed with the pip extras ``ptk``, ``proctitle``, ``linux``, ``mac``, and ``win``.
* Env ``help`` method to format and print the vardocs for an envvar
* test_news fails if no empty line before a category
* more info on test_news failures
* Added ``on_precommand`` and ``on_postcommand`` `events </events.html>`_
* New ``FORMATTER_DICT`` entry ``gitstatus`` to provides informative git status
* FOREIGN_ALIASES_OVERRIDE envvar to control whether foreign aliases should
override xonsh aliases with the same name.

* Warning on tutorial about foreign aliases being ignored if a xonsh alias
exist with the same name if not FOREIGN_ALIASES_OVERRIDE.
* The prompt-toolkit shell now auto-inserts matching parentheses, brackets, and quotes. Enabled via the ``XONSH_AUTOPAIR`` environment variable
* Better syntax highlights in prompt-toolkit, including valid command / path highlighting, macro syntax highlighting, and more
* More info on tutorial about history interaction
* Entry on bash_to_xsh
* Macro context managers are now available via the ``with!``
syntax.


**Changed:**

* Devguide reflects the current process of releasing through ``release.xsh``
* moved ``which`` from ``xonsh.aliases`` into ``xoreutils.which``
* ``xonsh.prompt.gitstatus.gitstatus`` now returns a namedtuple

* implementation of ``xonsh.prompt.vc_branch.get_git_branch`` and
``xonsh.prompt.vc_branch.git_dirty_working_directory`` to use 'git status --procelain'
* moved prompt formatting specific functions from ``xonsh.environ``
to ``xonsh.prompt.base``
* All prompt formatter functions moved to ``xonsh.prompt`` subpackage
* Printing the message about foreign aliases being ignored happens only
if XONSH_DEBUG is set.
* Use ``SetConsoleTitleW()`` on Windows instead of a process call.
* Tutorial to reflect the current history command argument functionality
* Macro function arguments now default to ``str``, rather than ``eval``,
for consistency with other parts of the macro system.


**Removed:**

* aliases that use '!' in their name cause they clash with the macro syntax


**Fixed:**

* Fix regression where bash git completions where not loaded
automatically when GitForWindows is installed.
* More tokens are now supported in subproc args, such as ``==``.
* Python completions now work without space delimiters, e.g. ``a=matpl<TAB>``
will complete to ``a=matplotlib``
* Parser would fail on nested, captured suprocess macros. Now, it works,
hooray!?
* now fires chdir event if OS change in working directory is detected.
* ``xonsh.prompt.vc_branch.git_dirty_working_directory``
uses ``porcelain`` option instead of using the bytestring
``nothing to commit`` to find out if a git directory is dirty
* Fix bug where know commands where not highlighted on windows.
* Fixed completer showing executable in upper case on windows.
* Fixed issue where tilde expansion was occurring more than once before an
equals sign.
* test_dirstack test_cdpath_expansion leaving stray testing dirs
* Better completer display for long completions in prompt-toolkit
* Automatically append newline to target of ``source`` alias, so that it may
be exec'd.
* test_news fails when single graves around word
* Slashes in virtual environment names work in vox
* non string type value in $FORMATTER_DICT turning prompt ugly
* whole prompt turning useless when one formatting function raises an exception
* Fix completion after alias expansion
* Fix hard crash when foreign shell functions fails to run. 1715
* Bug where non-default locations for ``XDG_DATA_HOME`` and ``XONSH_DATA_DIR``
would not expand ``~`` into the home directory
* Auto quote path completions if path contains 'and' or 'or'

* Completion now works on subcommands after pipe, ``&&``, ``||`` and so on.
* cd . and cd <singleCharacter> now work. Fix indexerror in AUTO_PUSHD case, too.
* Fixed issue with accidentally wrapping generators inside of function calls.
* History indexing with string returns most recent command.

0.4.6

====================

**Added:**

* New option ``COMPLETIONS_CONFIRM``. When set, ``<Enter>`` is used to confirm
completion instead of running command while completion menu is displayed.
* NetBSD is now supported.
* Macro function calls are now available. These use a Rust-like
``f!(arg)`` syntax.
* Macro subprocess call now available with the ``echo! x y z``
syntax.
* A new `event subsystem <http://xon.sh/tutorial_events.html>`_ has been added.
* howto install sections for Debian/Ubuntu and Fedora.
* ``History`` methods ``__iter__`` and ``__getitem__``

* ``tools.get_portions`` that yields parts of an iterable
* Added a py.test plugin to collect ``test_*.xsh`` files and run ``test_*()`` functions.
* ``__repr__`` and ``__str__`` magic method on LazyObject


**Changed:**

* ``create_module`` implementation on XonshImportHook
* Results of the ``bash`` tab completer are now properly escaped (quoted) when necessary.
* Foreign aliases that match xonsh builtin aliases are now ignored with a warning.
* ``prompt_toolkit`` completions now only show the rightmost portion
of a given completion in the dropdown
* The value of ``'none'`` is no longer allowed for ``$SHELL_TYPE`` just during the initial
load from the environment. ``-D``, later times, and other sources still work.
* ``yacc_debug=True`` now load the parser on the same thread that the
Parser instance is created. ``setup.py`` now uses this synchronous
form as it was causing the parser table to be missed by some package
managers.
* Tilde expansion for the home directory now has the same semantics as Bash.
Previously it only matched leading tildes.
* Context sensitive AST transformation now checks that all names in an
expression are in scope. If they are, then Python mode is retained. However,
if even one is missing, subprocess wrapping is attempted. Previously, only the
left-most name was examined for being within scope.
* ``dirstack.pushd`` and ``dirstack.popd`` now handle UNC paths (of form ``\\<server>\<share>\...``), but only on Windows.
They emulate behavior of `CMD.EXE` by creating a temporary mapped drive letter (starting from z: down) to replace
the ``\\<server>\<share>`` portion of the path, on the ``pushd`` and unmapping the drive letter when all references
to it are popped.

* And ``dirstack`` suppresses this temporary drive mapping funky jive if registry entry
``HKCU\software\microsoft\command processor\DisableUNCCheck`` (or HKLM\...) is a DWORD value 1. This allows Xonsh
to show the actual UNC path in your prompt string and *also* allows subprocess commands invoking `CMD.EXE` to run in
the expected working directory. See https://support.microsoft.com/en-us/kb/156276 to satisfy any lingering curiosity.
* ``lazy_locate_binary`` handles binary on different drive letter than current working directory (on Windows).
* ``_curr_session_parser`` now iterates over ``History``
* New implementation of bash completer with better performance and compatibility.
* ``$COMPLETIONS_BRACKETS`` is now available to determine whether or not to
include opening brackets in Python completions
* ``xonsh.bat`` tries to use `pylauncher <https://www.python.org/dev/peps/pep-0397/>`_ when available.


**Removed:**

* ``History`` method ``show``
* ``_hist_get_portion`` in favor of ``tools.get_portions``
* Unused imports in proc, flake8.


**Fixed:**

* xonsh modules imported now have the __file__ attribute
* Context sensitive AST transformer was not adding argument names to the
local scope. This would then enable extraneous subprocess mode wrapping
for expressions whose leftmost name was function argument. This has been
fixed by properly adding the argument names to the scope.
* Foreign shell functions that are mapped to empty filenames no longer
receive aliases since they can't be found to source later.
* Correctly preserve arguments given to xon.sh, in case there are quoted ones.
* Environment variables in subprocess mode were not being expanded
unless they were in a sting. They are now expanded properly.
* Fixed a bug that prevented xonsh from running scripts with code caching disabled.
* Text of instructions to download missing program now does not get off and
appears in whole.
* Fix some test problems when win_unicode_console was installed on windows.
* Fixed bug that prompt string and ``$PWD`` failed to track change in actual working directory if the
invoked Python function happened to change it (e.g via os.chdir(). Fix is to update ``$PWD``
after each command in BaseShell.default().
* The interactive prompt now correctly handles multiline strings.
* ``cd \\<server>\<share>`` now works when $AUTO_PUSHD is set, either creating a temporary mapped drive or simply
setting UNC working directory based on registry ``DisableUNCCheck``. However, if $AUTO_PUSHD is not set and UNC
checking is enabled (default for Windows), it issues an error message and fails. This improves on prior behavior,
which would fail to change the current working directory, but would set $PWD and prompt string to the UNC path,
creating false expectations.
* fix parsing for tuple of tuples (like `(),()`)
* ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` no longer complete with
opening square brackets
* xonsh now properly handles syntax error messages arising from using values in inappropriate contexts (e.g., ``del 7``).

0.4.5

====================

**Added:**

* ``_hist_get`` that uses generators to filter and fetch
the history commands of each session.

* ``-n`` option to the show subcommand to choose
to numerate the commands.
* The ``exec`` command is now a first class alias that acts the same way as in
sh-based languages. It replaces the current process with the command and
argument that follows it. This allows xonsh to be used as a default shell
while maintaining functionality with SSH, gdb, and other third party programs
that assume the default shell supports raw ``exec command [args]`` syntax.

This feature introduces some ambiguity between exec-as-a-subprocess and
exec-as-a-function (the inescapable Python builtin). Though the two pieces of
syntax do not overlap, they perform very different operations. Please see
the xonsh FAQ for more information on trade-offs and mitigation strategies.
* ``which -v`` now calls superhelp, which will print highlighted source.
* Added xontribs:
* `z (Tracks your most used directories, based on 'frecency'.) <https://github.com/AstraLuma/xontrib-z>`_
* amalgamate.py now supports relative imports.
* ``history show`` args ``-t``, ``-f``, ``-T`` ``+T`` to filter commands by timestamp

* ``ensure_timestamp`` in xonsh.tools to try and convert an object to a timestamp a.k.a float

* ``$XONSH_DATETIME_FORMAT`` envvar, the default format to be used with ``datetime.datetime.strptime()``
* ``xon.sh`` script now sets ``$LANG=C.UTF8`` in the event that no encoding
is detected.
* amalgamate.py now properly handles ``from __future__`` imports.


**Changed:**

* ``_hist_show`` now uses ``_hist_get`` to print out the commands.
* ``xonsh.completers`` sub-package is now fully lazy.
* The vox xontrib now takes flags very similar to Python's venv tool. Use
``vox --help <command>`` to learn more.
* Xontribs may now define ``__all__`` as a module top-level to limit what gets exported to the shell context
* xon.sh uses the interpreter used to install instead of the default python3.
* ``imphooks`` now checks directory access rights.
* $TITLE now changes both icon (tab) and window title
* Moved ``amalgamate_source`` outside ``build_tables``

* Disable amalgamation on setup develop
* ``_hist_parse_args`` implementation refactor

* moved all parameter checking in ``_hist_get``

* ``_hist_show`` to handle numeration and timestamp printing of commands
* ``xonsh.imphooks`` does not install the import hooks automatically, you now
need to explicitly call the `install_hook()` method defined in this module.
For example: ``from xonsh.imphooks import install_hook; install_hook()``. The
``install_hook`` method can safely be called several times. If you need
compatibility with previous versions of Xonsh you can use the following::

from xonsh import imphooks
getattr(imphooks, 'install_hook', lambda:None)()
* xonfig command now dumps more encoding related settings.


**Removed:**

* Anaconda Build is shutting down so we can no longer build conda development packages.
All references to these packages are removed from the documentation.
* Removed conda build recipe since the it is no longer used for Anaconda Build.
The recipe used to build xonsh on conda-forge can be found here:
https://github.com/conda-forge/xonsh-feedstock/blob/master/recipe/meta.yaml


**Fixed:**

* ``_zsh_hist_parser`` not parsing history files without timestamps.
* Fixed amalgamation of aliased imports that are already in ``sys.modules``.
* Xonsh will no longer fail to start in directories where the user doesn't have
read access.
* Fixed parser error line number exception from being raised while trying to
raise a SyntaxError.
* Made pip completer more robust to when pip is not installed.
* Fix a startup problem on windows caused by a refactor of Prompt_toolkit.
https://github.com/jonathanslenders/python-prompt-toolkit/commit/a9df2a2
* ``ensure_slice`` bugfix for -1 index/slice
* Alias tab completion works again
* Version number reported by bundled PLY
* ``xonfig`` no longer breaks if PLY is externally installed and version 3.8
* LazyObject supports set union
* Fixed error with not sourcing files with ``$XONSH_ENCODING`` and
``$XONSH_ENCODING_ERRORS``.
* ``$IGNOREEOF`` envrionment variable now works properly in the
prompt-toolkit shell.
* Completions in ``jupyter_kernel.py`` now use updated completion framework

Page 17 of 20

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.