xonsh v0.2.7 Release Notes

  • โž• Added:

    • โž• Added new valid $SHELL_TYPE called 'best'. This selects the best value for the concrete shell type based on the availability on the user's machine.
    • New environment variable $XONSH_COLOR_STYLE will set the color mapping for all of xonsh.
    • ๐Ÿ†• New XonshStyle pygments style will determine the appropriate color mapping based on $XONSH_COLOR_STYLE. The associated xonsh_style_proxy() is intended for wrapping XonshStyle when actually being used by pygments.
    • The functions print_color() and format_color() found in xonsh.tools dispatch to the approriate shell color handling and may be used from anywhere.
    • xonsh.tools.HAVE_PYGMENTS flag now denotes if pygments is installed and available on the users system.
    • The ansi_colors module is now available for handling ANSI color codes.
    • ? and ?? operator output now has colored titles, like in IPython.
    • ?? will syntax highlight source code if pygments is available.
    • Python mode output is now syntax highlighted if pygments is available.
    • ๐Ÿ†• New $RIGHT_PROMPT environment variable for displaying right-aligned text in prompt-toolkit shell.
    • โž• Added !(...) operator, which returns an object representing the result of running a command. The truth value of this object is True if the return code is equal to zero and False otherwise.
    • Optional dependency on the win_unicode_console package to enable unicode support in cmd.exe on Windows. This can be disabled/enabled with the $WIN_UNICODE_CONSOLE environment variable.

    ๐Ÿ”„ Changed:

    • โšก๏ธ Updated $SHELL_TYPE default to 'best'.
    • Shell classes are now responsible for implementing their own color formatting and printing.
    • Prompt coloring, history diffing, and tracing uses new color handling capabilities.
    • ๐Ÿ†• New Token.Color token for xonsh color names, e.g. we now use Token.Color.RED rather than Token.RED.
    • Untracked files in git are ignored when determining if a git workdir is is dirty. This affects the coloring of the branch label.
    • Regular expression globbing now uses re.fullmatch instead of re.match, and the result of an empty regex glob does not cause the argument to be deleted.

    โœ‚ Removed:

    • The xonsh.tools.TERM_COLORS mapping has been axed, along with all references to it. This may cause a problem if you were using a raw color code in your xonshrc file from $FORMATTER_DICT. To fix, simply remove these references.

    ๐Ÿ›  Fixed:

    • Multidimensional slicing, as in numpy, no longer throws SyntaxErrors.
    • ๐Ÿ›  Some minor zsh fixes for more platforms and setups.
    • The BaseShell.settitle method no longer has its commands captured by $(...)