xonsh

Python-powered, cross-platform, Unix-gazing shell.

OTHER License

Downloads
69K
Stars
8K
Committers
330

Bot releases are visible (Hide)

xonsh - 0.8.2

Published by scopatz almost 6 years ago

Changed:

  • Now there is only a single instance of string.Formatter() in the
    code base, which is called xonsh.tools.FORMATTER.

Fixed:

  • f-strings (f"{expr}") are now fully capable of executing xonsh expressions.
    The one exception to this is that ![cmd] and !(cmd) don't work because
    the ! character interferes with Python string formatting. If you need to
    run subprocesses inside of f-strings, use $[cmd] and $(cmd) instead.
  • Fixed occasional "no attribute 'settitle' error"
xonsh - 0.8.1

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:

  • Removed fish from list of supported foreign shells in the wizard.
  • Circle CI config updated to use a pinned version of black (18.9b0)
  • Pytest plugin now uses xonsh.main.setup() to setup test environment.
  • Linux platform discovery will no longer use platform.linux_distribution()
    on Python >=3.6.6. due to pending deprecation warning.
  • Updated Linux Guide as Xonsh is now available in Arch Linux official repositories.

Fixed:

  • Builtin dynamic proxies and deprecation warning proxies were not deleting
    attributes and items properly.
  • Fixed stdout/sdterr writing infinite recurssion error that would occur in
    long pipelines of callable aliases.
  • Fixed a bug which under very rare conditions could cause the shell
    to die with PermissionError exception while sending SIGSTOP signal
    to a child process.
  • Fixed further raw string deprecation warnings thoughout the code base.
xonsh - 0.8.0

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:

  • All __xonsh_*__ builtins have been migrated to a XonshSession instance at
    __xonsh__. E.g. __xonsh_env__ is now __xonsh__.env.
  • Other xonsh-specific builtins (such as XonshError) have been proxied to
    the __xonsh__ session object as well.

Deprecated:

  • All __xonsh_*__ builtins are deprected. Instead, the corresponding
    __xonsh__.* accessor should be used. The existing __xonsh_*__ accessors
    still work, but issue annoying warnings.

Fixed:

  • 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

xonsh - 0.7.10

Published by scopatz about 6 years ago

Added:

  • 'off' can be passed as falsy value to all flags accepting boolean argument.
  • DragonFly BSD support
  • Format strings (f-strings) now allow environment variables to be looked up.
    For example, f"{$HOME}" will yield "/home/user". Note that this will
    look up and fill in the detype()-ed version of the environment variable,
    i.e. it's native string representation.

Changed:

  • Running aurman command will now be predicted to be unthreaded by default.

Fixed:

  • The xonsh xonfig wizard would crash if an unknown foreign shell was
    provided. This has been fixed.
  • The hg split command will now predict as unthreadable.
  • Fixed path completer crash on attempted f-string completion
xonsh - 0.7.9

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:

  • In Bash completions, if there are no files to source, a set() will
    no longer be inserted into the completion script.
  • Fixed issue with TAB completion in readline not replacing values
    with spaces properly when the prefix was unquoted.
xonsh - 0.7.8

Published by scopatz about 6 years ago

Added:

  • xonsh.lib.collections.ChainDB, a chain map which merges mergable fields

Fixed:

  • Pass all params to voxapi.create
  • PTK tab-completion now auto-accepts completion if only one option is present
    (note that fix is only for PTK2)
xonsh - 0.7.7

Published by scopatz about 6 years ago

Added:

  • A xontrib which adds support for autojump to xonsh
  • Added new env-var XONSH_HISTORY_MATCH_ANYWHERE. If set to True then
    up-arrow history matching will match existing history entries with the search
    term located anywhere, not just at the beginning of the line. Default value is
    False

Changed:

  • Improved iteration over virtual environments in Vox.iter

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.

xonsh - 0.7.6

Published by scopatz about 6 years ago

Added:

  • Callable aliases may now accept a stack argument. If they do, then the
    stack, as computed from the aliases call site, is provided as a list of
    FrameInfo objects (as detailed in the standard library inspect
    module). Otherwise, the stack parameter is None.
  • SubprocSpec now has a stack attribute, for passing the call stack
    to callable aliases. This defaults to None if the spec does not
    need the stack. The resolve_stack() method computes the stack
    attribute.

Changed:

  • xonsh/environ.py
    Exceptions are caught in the code executed under Env.swap()

Fixed:

  • Scripts are now cached by their realpath, not just abspath.
  • Fixed a potential crash (AssertionError: wrong color format) on Python 3.5 and prompt_toolkit 1.
  • The completer command now correctly finds completion functions
    when nested inside of other functions.
  • Fixed a crash when using the $XONSH_STDERR_PREFIX/POSTFIX with
    prompt_toolkit and Pygments 2.2.
xonsh - 0.7.5

Published by scopatz about 6 years ago

Fixed:

  • Recent command history in ptk2 prompt now returns most recently executed
    commands first (as expected)
  • Fixed a regression taat prevented the readline backend from beeing used. This
    regression was caused by the new ansi-color names, which are incompatible with
    pygments 2.2.
xonsh - 0.7.4

Published by scopatz about 6 years ago

Added:

  • New xonsh-cat command line utility, which is a xonsh replacement
    for the standard UNIX cat command.
  • The new xonsh.xoreutils.cat.cat_main() enables the xonsh.xoreutils.cat
    module to be run as a command line utility.
  • New CommandsCache.is_only_functional_alias() and
    CommandsCache.lazy_is_only_functional_alias() methods for determining if
    if a command name is only implemented as a function, and thus has no
    underlying binary command to execute.
  • xonsh.xontribs.xontribs_load() is a new first-class API for loading
    xontribs via a Python function.
  • $COMPLETIONS_DISPLAY now supports readline-like behavior on
    prompt-toolkit v2.

Changed:

  • The xonsh Jupyter kernel now will properly redirect the output of commands
    such as git log, man, less and other paged commands to the client.
    This is done by setting $PAGER = 'cat'. If cat is not available
    on the system, xonsh-cat is used instead.
  • The setup() function for starting up a working xonsh has aliases,
    xontribs, and threadable_predictors as new additional keyword
    arguments for customizing the loading of xonsh.

Fixed:

  • Fixed a bug with converting new PTK2 colors names to old names when using PTK1 or Jupyter
    as the shell type.
  • CommandsCache.locate_binary() will now properly return None when
    ignore_alias=False and the command is only a functional alias,
    such as with cd. Previously, it would return the name of the
    command.
  • Fixed issue with $COMPLETIONS_DISPLAY raising an error on
    prompt-toolkit v2 when the value was not set to multi.
  • ValueError when executing vox list
xonsh - 0.7.3

Published by scopatz about 6 years ago

Added:

  • Add the PROMPT_TOOLKIT_COLOR_DEPTH environment to xonsh default environment.
    Possible values are DEPTH_1_BIT/MONOCHROME,
    DEPTH_4_BIT/ANSI_COLORS_ONLY, DEPTH_8_BIT/DEFAULT, or DEPTH_24_BIT/TRUE_COLOR.
    Note: not all terminals support all color depths.
  • New way to fix unreadable default terminal colors on Windows 10. Windows 10
    now supports true color in the terminal, so if prompt toolkit 2 is
    installed Xonsh will use a style with hard coded colors instead of the
    default terminal colors. This will give the same color experience as on linux an mac.
    The behaviour can be disabled with $INTENSIFY_COLORS_ON_WIN
    environment variable.
  • New JupyterShell for interactive interfacing with Jupyter.

Changed:

  • All ansicolor names used in styles have ben updated to the color names used by prompt_toolkit 2.
    The new names are are much easier to understand
    (e.g. ansicyan/ansibrightcyan vs. the old #ansiteal/#ansiturquoise). The names are automatically
    translated back when using prompt_toolkit 1.

Removed:

  • Removed support for pygments < 2.2.

Fixed:

  • New ansi-color names fixes the problem with darker colors using prompt_toolkit 2 on windows.
  • Fixed a problem with the color styles on prompt toolkit 2. The default pygment
    style is no longer merged into style selected in xonsh.
  • The JupyterKernel has been fixed from a rather broken state.
xonsh - 0.7.2

Published by scopatz about 6 years ago

Added:

  • history show builtin now supports optional -0 parameter that switches
    the output to null-delimited. Useful for piping history to external filters.

Fixed:

  • If exception is raised in indir context manager, return to original directory
  • Fixed issue that autocomplete menu does not display
    at terminal's maximum height
xonsh - 0.7.1

Published by scopatz about 6 years ago

Added:

  • Added feature to aliases.
  • xonsh.lib.os.rmtree() an rmtree which works on windows properly (even with
    git)

Changed:

  • set default value of $AUTO_SUGGEST_IN_COMPLETIONS=False
  • Use the pygments_cache.get_all_styles() function instead of
    interacting directly with pygments.

Fixed:

  • 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 present
  • Fixed a regression with xonfig styles reporting AttributeError: module 'pygments' has no attribute 'styles'
  • ptk dependent xontribs (that use custom keybindings) now work with both ptk1
    and ptk2
  • Fixed async tokenizing issue on Python v3.7.
xonsh - 0.7.0

Published by scopatz over 6 years ago

Added:

  • Added a hook for printing a spcial display method on an object.
  • Support for prompt_toolkit 2.0
  • The --shell-type ($SHELL_TYPE) may now be specified using
    shortcuts, such as rl for readline and ptk2 for
    prompt_toolkit2. See xonsh --help for a full listing
    of available aliases.

Fixed:

  • Restored AUGASSIGN_OPS definition, which was inadvertently removed.
xonsh - 0.6.10

Published by scopatz over 6 years ago

Added:

  • xonsh.lib.subprocess.check_output as a check_output drop in

Fixed:

  • xonsh.lib.subprocess.run doesn't change dirs unless asked
xonsh - 0.6.9

Published by scopatz over 6 years ago

Added:

  • New xonsh standard library xonsh.lib subpackage
  • xonsh.lib.os.indir a context manager for temporarily entering into a directory
  • xonsh.lib.subprocess.run and xonsh.lib.subprocess.check_call
    subprocess stubs using xonsh as the backend

Fixed:

  • update xoreutils._which.which() for python 3.x support.
  • Fixed issue with incorrect strip lengths for prefixes with quotes in them
  • Fixed bash script to also consider leading double quotes and not just single
    quotes
  • Launching xonsh with prompt_toolkit version 2.x no longer fails, and instead fallsback to readline shell. This is a patch for until prompt_toolkit 2.x support is fully implemented. See PR #2570
xonsh - 0.6.8

Published by scopatz over 6 years ago

Fixed:

  • completions relative to CDPATH only trigger when used with cd
  • Import of ctypes.util is now explictly performed, as needed.
    Python v3.7 no longer imports this module along with ctypes.
  • Fixed issue with pygments-cache not properly generating a cache the first
    time when using prompt-toolkit. This was due to a lingering lazy import
    of pkg_resources that has been removed.
  • Removed duplicate pip completer
  • bash_completion no longer returns invalid prefix lengths for directories
    containing escape file names
  • Fixed error when using redirection (e.g., >) on Windows.
xonsh - 0.6.7

Published by scopatz over 6 years ago

Changed:

  • Xonsh live example has been re-added back to the documentation.

Fixed:

  • Fixed issue where xonsh would fail to properly return the terminal prompt
    (and eat up 100% CPU) after a failed subprocess command in interactive mode
    if $RAISE_SUBPROC_ERROR = True.
  • xonsh.tokenize.tok_name no longer mutates the standard library tokenize.tok_name.
    A copy is made on import instead.
xonsh - 0.6.6

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:

  • built_ins.py, corrected a typo.
  • test/test_news.py
    It now uses regex to verify the format of rst files
  • Mercurial (hg) will no longer run in a threadable subprocess when
    it is run in interactive mode.

Fixed:

  • issue 2313
xonsh - 0.6.5

Published by scopatz over 6 years ago

Added:

  • Wizard FileInsterter node class now has dumps() method for
    converting a mapping to a string to insert in a file.

Fixed:

  • Fixed issue with xonfig wizard writer failing to write valid run control
    files for environment variables that are containter types. In particular,
    the storage of $XONSH_HISTORY_SIZE has been fixed.