Skip to main content

myrtui

English | 简体中文

PyPI Python License: MIT Platforms

A project-scoped terminal workspace: a file tree and git log on the left, up to four real shell panes on the right — one session per project, restored where you left it.

It is not a tmux replacement. myrtui drives tmux (via a per-project socket) and adds the things tmux deliberately leaves out.

Why not just tmux

tmux / zellij tmuxinator / sesh myrtui
One session per project, named and isolated automatically manual needs a config file cd project && myrtui
File tree + git history next to your shells — — Yes
Layout ratios remembered per project — re-edit config Yes
Open / preview Markdown, images, LaTeX — — Yes
Detach / re-attach, shells survive Yes Yes Yes

Features

  • One directory = one instance. Session identity is derived from the realpath, so two projects never collide; running myrtui again attaches to the same session with your panes, layout and scrollback intact.
  • Up to 4 real tmux panes with mouse support: click to focus, wheel to scroll, drag splitters to resize (ratios persisted per project).
  • File tree with git status colours (VS Code conventions), lazy-loaded, context menu for open / preview / copy path.
  • Git history panel — repo-wide or per file, hover a commit for details.
  • Markdown preview with GFM, $math$ via termtex, optional full-page LaTeX typesetting through KaTeX on a sepia page (v).
  • Image preview with Sixel / Kitty graphics where the terminal supports it.
  • Selection and clipboard that actually work inside a TUI: drag to select, release to copy (OSC 52 + native clipboard commands).

Install

Requires tmux >= 3.1 and Python >= 3.10 (macOS and Linux; Windows is not supported — fcntl and no native tmux).

brew install tmux              # Linux: sudo apt install tmux
pipx install myrtui
myrtui --version

Or use the installer that also checks dependencies and offers the optional tools (micro, ov, termtex):

curl -fsSL https://raw.githubusercontent.com/YidingPing/myrtui/main/scripts/install.sh | sh

Upgrade with pipx upgrade myrtui. Annotations: Python ≥ 3.12 automatically pulls the bitmap extras (textual-image + Pillow); on 3.10/3.11 previews fall back to text, everything else works.

Usage

cd some-project
myrtui                 # first run creates the session, later runs attach
  • myrtui ls — list live instances (add --all for dead leftovers, --json);
  • myrtui attach [target] — target = index, hash prefix, or path;
  • myrtui stop [target] — cooperative shutdown (never kills panes);
  • myrtui --root /path/to/other/project — work on a second project without cd; --shell and --scrollback set the pane shell / history limit.

Keys (Ctrl-a prefix)

Key Action
Ctrl-a d detach — quit the UI, keep every shell running
Ctrl-a k kill the session (asks first)
Ctrl-a t / w open / close a pane (up to 4)
Ctrl-a 1..4 focus pane N
Ctrl-a r re-open a dead pane
Ctrl-a b collapse / expand the sidebar
Ctrl-a s / g focus the file tree / git history
Ctrl-a c / v copy selection / paste

Everything else goes straight to the inner shell. Esc returns from the sidebar to the active pane; Ctrl-a ? (or hovering ? in the top bar) shows the full cheat sheet. Full tables: docs/USAGE.md.

Configuration

Environment variables
Variable Meaning
MYRTUI_LANG UI language: en (default) / zh_CN; --lang overrides it for one run
MYRTUI_EDITOR editor for "Open" (falls back to $EDITOR / $VISUAL / micro → vim → vi)
MYRTUI_IDLE_INTERVAL idle capture interval in seconds (default 0.15, range 0.05–5.0); polling speeds up automatically (~17 Hz) while pane content keeps changing; raise it for background instances
MYRTUI_TRANSPORT tmux transport: auto (default: resident tmux -C client, per-call processes as fallback) / exec (one process per call) / control (force the resident client)
MYRTUI_LOG where warnings go once the TUI owns the terminal (default: the platform log dir, e.g. ~/Library/Logs/myrtui/myrtui.log); empty disables it
MYRTUI_COPY_ON_SELECT auto-copy on drag release (default 1; 0 keeps the selection for Ctrl-a c)
MYRTUI_DRAG_SELECT always (default) = drag always selects; app = when the pane program requested mouse, drag is forwarded to it
MYRTUI_GRAPHICS bitmap protocol: auto (default) / sixel / tgp / unicode / off
MYRTUI_PAGE_THEME LaTeX page theme: sepia (default) / paper / gray / white / dim / dark
MYRTUI_MATH_BACKEND math backend for Markdown preview: auto (default) / plain / termtex
MYRTUI_CELL_PX override the terminal cell size (10x20) when it is not reported
MYRTUI_CHROME Chrome/Chromium binary for the LaTeX page view
MYRTUI_PDFTOCAIRO PDF → PNG converter (pdftocairo preferred, then pdftoppm)
MYRTUI_LOOP_DEBUG / MYRTUI_MOUSE_DEBUG write timing / mouse event diagnostics to stderr or a temp log

Limitations

  • macOS / Linux only — Windows has no native tmux and cli.py needs fcntl.
  • Clicks inside panes are delayed by 50–150 ms — dragging always belongs to selection, so a click is injected on release (use MYRTUI_DRAG_SELECT=app to give drag back to the program).
  • No bitmap inside panes — images render in the preview layer only.
  • Soft-wrapped lines copy with extra newlines (capture works line by line).
  • Echo latency ~150 ms when idle — tmux capture is polled; typing raises the rate to ~30 ms.

Docs & contributing

  • docs/USAGE.md — the full manual (keys, previews, splitters, instance management, all environment variables). Also available in Chinese.
  • docs/ARCHITECTURE.md — module map and design decisions.
  • CONTRIBUTING.md — how to run tests, the language policy, and how the project is built.

Code comments and docstrings are written in Chinese by project convention; user-facing text (this README, the UI, docs/) is available in English. Issues and pull requests in either language are welcome.

License

MIT — see LICENSE.

Metadata

Release files for myrtui 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for myrtui 0.6.1
File Size Uploaded Provenance Actions
myrtui-0.6.1.tar.gz 746.8 kB With provenance Details for myrtui-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for myrtui 0.6.1
File Interpreter ABI Platform Actions
myrtui-0.6.1-py3-none-any.whl Python 3 none any Details for myrtui-0.6.1-py3-none-any.whl

Total release size: 1.3 MB

Release files / myrtui-0.6.1.tar.gz

Download URL myrtui-0.6.1.tar.gz
Size 746.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3cb74f3d90b4a9ad7539ecedbec1ea747ec78aa6ef96aba96c06eecbf526fef6
BLAKE2b-256 checksum
How to use checksums
c28e45a267916ac48aca370450faa343b5f2e35532166426e59a5b634915b2ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / myrtui-0.6.1-py3-none-any.whl

Download URL myrtui-0.6.1-py3-none-any.whl
Size 578.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cebb1a4387e99801add97a2f7de8259b2e9c1ec0cbf1ca4788136bba445e314
BLAKE2b-256 checksum
How to use checksums
490462136a20ce208163e3d2dc3b64166412b56275499b3c87d0710bb680af4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for myrtui 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for myrtui-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page