Tako: Changes From Xonsh
This page contains an attempt to describe the differences between tako
and modern versions of xonsh.
tako is, in some ways, a more minimalist shell than xonsh. The goal
is to sacrifice some of the "fancy stuff" so that basic shell operations work
as expected, the codebase is small, and things are as performant as can be
expected from a shell written in Python. As such, a number of pieces of xonsh
- tako only supports a readline-based shell interface (the prompt-toolkit-based shell was removed).
- Support for running in Microsoft Windows natively was removed (though it is still possible to run under Windows via Cygwin).
- The notion of "rich history" is removed completely, as it complicated or broke a number of basic shell operations.
- A big rewrite of the way subprocess-mode commands are handled was rolled back because it caused a number of issues with job control.
- Branch information for version control systems (Mercurial/Git) was removed by default because of performance issues.
- The "amalgamation" optimization was removed because it complicated the codebase and error reporting.
- All reliance on foreign shells was removed (except for, optionally, tab completion via Bash).
- The (unused) Block and Functor contexts have been removed.
Many of these changes were made in an attempt to reduce the size and complexity
of the codebase, and to fix multiple breaking issues with management of
subprocess-mode commands. When the project was first forked, these changes led
to a drastic reduction in the size of the codebase (~3MB vs ~10MB), increased
startup times by a factor of 3, and dramatically reduced CPU load. I have not
done any testing recently.
While a big part of the fork indeed involved removing large portions of the
xonsh codebase, a number of new features and changes have also been introduced:
- disowning a process is possible in tako.
- Tako-specific settings have been moved out of environment variables and into a special settings object.
- Static JSON configuration has been replaced with preload.tako and config.tako in $XDG_CONFIG_HOME.
- Trailing newline characters are now removed from all outputs from !() and $().
- The more standard $n notation is used for accessing arguments in scripts, instead of $ARGn.
- Brace expansion is now allowed inside of g`` "strings".
- Prompt format strings are now evaluated recursively, allowing elements in PATH_FIELDS to return strings containing formatting fields themselves.
- Support for 256 colors in prompt formatting fields.
- tako supports three different means of handling numbers: exact (decimals and fractions are stored in exact form as long as possible), python (Pythonic number treatment), and hybrid (like exact, except decimals are immediately represented as floats).
- Tuples and "bare" generators can be used in @(...).
- umask is implemented as a built-in command.
- echo is implemented as a built-in command to avoid issues with large arguments.
- Indentation level is cleared on a KeyboardInterrupt.
- tako has a different way of handling plugins and event hooks.
Some of these changes have been ported to xonsh, and a number of bugfixes and features have been ported into tako from "modern" xonsh, as well.
An additional change is related to licensing: while xonsh is licensed under a BSD-style license, tako is licensed under the GNU GPL, version 3+.