WARNING: This project requires maintenance. The current master branch requires
an old version of both prompt_toolkit and ptterm. There is a prompt-toolkit-3.0
branch here that is compatible with the latest prompt_toolkit and the latest
commit of the master branch of ptterm, but for that branch, only pymux standalone
is working at the moment.
A terminal multiplexer (like tmux) in Python
::
pip install pymux
.. image :: https://raw.githubusercontent.com/jonathanslenders/pymux/master/images/pymux.png
Issues, questions, wishes, comments, feedback, remarks? Please create a GitHub issue, I appreciate it.
Simply install pymux
using pip:
::
pip install pymux
Start it by typing pymux
.
A terminal multiplexer makes it possible to run multiple applications in the
same terminal. It does this by emulating a vt100 terminal for each application.
There are serveral programs doing this. The most famous are GNU Screen <https://www.gnu.org/software/screen/>
and tmux <https://tmux.github.io/>
.
Pymux is written entirely in Python. It doesn't need any C extension. It runs on all Python versions from 2.6 until 3.5. It should work on OS X and Linux.
To some extent, pymux is a clone of tmux. This means that all the default shortcuts are the same; the commands are the same or very similar, and even a simple configuration file could be the same. (There are some small incompatibilities.) However, we definitely don't intend to create a fully compatible clone. Right now, only a subset of the command options that tmux provides are supported.
Pymux implements a few improvements over tmux:
fish-style <http://fishshell.com/>
_ suggestions.prompt_toolkit <https://github.com/jonathanslenders/python-prompt-toolkit>
_.--truecolor
option at startup or during attach in order to
enable it.)About the performance:
find /
or yes
, pymux
will process the output slightly slower, and in this case render the output
only a few times per second to the terminal. Usually, this should not be an
issue. If it is, Pypy <http://pypy.org/>
_ should provide a significant
speedup.The big advantage of using Python and prompt_toolkit <https://github.com/jonathanslenders/python-prompt-toolkit>
_ is that the
implementation of new features becomes very easy.
24 bit color support and the autocompletion menu:
.. image :: https://raw.githubusercontent.com/jonathanslenders/pymux/master/images/menu-true-color.png
What happens if another client with a smaller screen size attaches:
.. image :: https://raw.githubusercontent.com/jonathanslenders/pymux/master/images/multiple-clients.png
When a pane enters copy mode, search results are highlighted:
.. image :: https://raw.githubusercontent.com/jonathanslenders/pymux/master/images/copy-mode.png
For several reasons. Having a terminal multiplexer in Python makes it easy to experiment and implement new features. While C is a good language, it's not as easy to develop as Python.
Just like pyvim <https://github.com/jonathanslenders/pyvim>
_ (A Vi
clone
in Python.), it started as another experiment. A project to challenge the
design of prompt_toolkit. At this point, however, pymux should be stable and
usable for daily work.
The development resulted in many improvements in prompt_toolkit, especially performance improvements, but also some functionality improvements.
Further, the development is especially interesting, because it touches so many different areas that are unknown to most Python developers. It also proves that Python is a good tool to create terminal applications.
There is no official roadmap, the code is mostly written for the fun and of course, time is limited, but I use pymux professionally and I'm eager to implement new ideas.
Some ideas:
pymux split-window
.
However, status codes and feedback aren't transferred yet.)pyvim <https://github.com/jonathanslenders/pyvim>
.)Create a file ~/.pymux.conf
, and populate it with commands, like you can
enter at the command line. There is an example config <https://github.com/jonathanslenders/pymux/blob/master/examples/example-config.conf>
_
in the examples directory.
If for some reason pymux crashes, it will attempt to write a stack trace to a
file with a name like /tmp/pymux.crash-*
. It is possible that the user
interface freezes. Please create a GitHub issue with this stack trace.
Pyte <https://github.com/selectel/pyte>
_, for providing a working vt100
parser. (This one is extended in order to support some xterm extensions.)docopt <http://docopt.org/>
_, for parsing the command line arguments.prompt_toolkit <https://github.com/jonathanslenders/python-prompt-toolkit>
_, for the UI
toolkit.wcwidth <https://github.com/jquast/wcwidth>
_: for better unicode support
(support of double width characters).tmux <https://tmux.github.io/>
_, for the inspiration.