Skip to main content

Clownfish 🐟

CI Python 3.14+ License: MIT

A lightweight, modern terminal emulator written in Python and Tkinter, featuring TrueColor rendering, full POSIX PTY bridge, mouse reporting, Unicode wide character support, device attribute queries, and shell integration.


Features

  • Split Navigation & Desktop Ergonomics: Fast split pane keyboard cycling (Cmd+[ / Cmd+] or Alt+[ / Alt+]), split equalization (Cmd+= / Ctrl+=), high-contrast active-pane visual border highlight (#4a90e2), and automatic current working directory inheritance on new tabs (Cmd+T) and split panes (Cmd+D).
  • High-Throughput PTY Batching & Idle Throttling: Bounded PTY event processing (drain_events(max_bytes=512_000)) with adaptive tick rate (after(1) for pending stream bursts, after(16) for interactive typing) and cursor state caching to eliminate canvas churn when idle.
  • Security & OSC Integrations: Base64 clipboard get/set (OSC 52) with size-bounded payload decoding, current working directory tracking (OSC 7), strict allowlisted URL scheme validation for hyperlinks (OSC 8), and desktop notifications (OSC 9 and OSC 777).
  • Unicode Grapheme Clusters & Complex Emojis: Support for Zero-Width Joiner (ZWJ, \u200D) connected emoji sequences (e.g. 👩‍💻), Fitzpatrick skin tone modifiers, regional indicator flag pairs (🇯🇵), and extended emoji/symbol pictographs in monospace terminal grid math.
  • VT/xterm & Keyboard Conformance: Full F1–F12 function key encoding, standard xterm modified navigation keys (Ctrl/Alt/Shift + Arrows/Home/End/PageUp/PageDown), DECOM Origin Mode (?6h/?6l), DECAWM Auto-wrap Mode (?7h/?7l), DECSCUSR cursor styles (block, underline, bar), and DEC Mode 2026 Synchronized Output for tear-free rendering.
  • Mouse Motion Reporting: Button motion tracking (?1002h) and any-event motion tracking (?1003h) alongside standard press/release (?1000h) and SGR format (?1006h).
  • Interactive Login Shells & Job Control: Launches native user shells (/bin/zsh, /bin/bash) as login interactive shells (-l -i) with controlling terminal allocation (TIOCSCTTY), pre-spawn window sizing (TIOCSWINSZ), and full POSIX job control (Ctrl+C, Ctrl+Z, fg, bg).
  • Non-Destructive Soft-Wrap Reflow: Dynamic text reflow (Row.is_wrapped) when resizing terminal columns, preserving character buffers, styles, wide glyphs, and cursor positioning without data loss.
  • Screen-Editing VT Sequences: Full support for Cursor Next/Previous Line (CSI E/F), Erase Characters (CSI X), Insert/Delete Lines (CSI L/M), Scroll Up/Down (CSI S/T), and ANSI Cursor Save/Restore (CSI s/u).
  • Prompt Preservation on Clear: Complete terminal reset (Cmd+K / Ctrl+K) flushes scrollback while requesting interactive shell redraw (Ctrl+L), preserving partially typed command lines.
  • Dynamic Window & Tab Titles: Shell precmd window and tab title sequences (OSC 0 and OSC 2) update desktop tab headers in real time.
  • Multi-Tab Terminal Sessions: Manage multiple independent terminal sessions with tab switching shortcuts (Cmd+T, Cmd+W, Cmd+1..9, Ctrl+Tab).
  • Split Panes: Divide any tab vertically (Cmd+D) or horizontally (Cmd+Shift+D) with native resizable sash dividers.
  • In-Buffer Search: Interactive search bar (Cmd+F) across active terminal screen and scrollback history with match highlighting and cycling.
  • User Preferences: Persistent configuration in ~/.config/clownfish/config.json.
  • TrueColor & 256-Color Support: Full 24-bit RGB TrueColor escaping and standard ANSI 16/256 palette support.
  • Full Screen & Scrollback Clear: Complete terminal reset with Cmd+K (macOS) or Ctrl+K (Linux/Windows) that flushes active screen and all 10,000 lines of scrollback buffer.
  • Unicode Wide Characters & Emojis: Character classification via East Asian Width (unicodedata.east_asian_width) for 2-column CJK characters and emojis with sentinel spacer cells.
  • Device Attribute Queries: Standard VT220 / xterm query responses for DA1 (\x1b[c), DA2 (\x1b[>c), DSR / CPR (\x1b[6n), and OSC 10/11 color queries, eliminating CLI boot delays.
  • Kitty Keyboard Protocol: Protocol flag negotiation (CSI ? u, CSI = u, CSI > u, CSI < u) enabling disambiguation of modified keystrokes like Shift+Enter.
  • OSC 133 Semantic Prompts: Shell integration tracking prompt start, command execution, and exit codes, enabling prompt-to-prompt jumping (Cmd+Up / Cmd+Down).
  • OSC 8 Hyperlinks: Clickable URLs with browser launching via Cmd+Click or Ctrl+Click.
  • Mouse Tracking: Normal tracking (?1000h) and SGR decimal tracking (?1006h) for interactive CLI programs like vim, htop, and tmux.
  • Primary & Alternate Screen Buffers: Smooth transitions into and out of full-screen terminal programs without corrupting main scrollback.

Installation & Running

Clownfish offers multiple installation channels: native macOS application bundle, Homebrew tap, PyPI package, or source.

Option 1: macOS Application Bundle (Clownfish.app)

Download the latest release archive from GitHub Releases:

  1. Download Clownfish-v0.5.0-macos.zip.
  2. Unzip the archive:
    unzip Clownfish-v0.5.0-macos.zip
    
  3. Move Clownfish.app to /Applications:
    mv Clownfish.app /Applications/
    
  4. Launch Clownfish from Spotlight, Finder, or from your terminal with open /Applications/Clownfish.app.

Option 2: Homebrew Tap (wispsy/homebrew-tap)

Install Clownfish via the official Wispsy Homebrew tap:

# Add the tap
brew tap wispsy/tap

# Install the CLI formula (isolated Python environment)
brew install clownfish

# Or install the standalone macOS GUI application via Cask
brew install --cask wispsy/tap/clownfish

Option 3: PyPI Package (pip / uv)

Clownfish is published to PyPI and requires Python 3.14+:

# Using uv (recommended)
uv tool install clownfish

# Or using pip
pip install clownfish

Run directly:

clownfish

Option 4: From Source (Development)

Ensure you have Python 3.14+ and uv installed.

git clone https://github.com/wispsy/clownfish.git
cd clownfish
uv sync --all-extras
uv run clownfish

To build the standalone macOS .app bundle from source:

uv run --with pyinstaller python scripts/build_macos_app.py

Testing & Quality Assurance

Run the test suite:

uv run pytest

Run code formatting and linting:

uv run ruff check .

Documentation


Project Structure

clownfish/
├── .github/
│   └── workflows/
│       ├── ci.yml                 # GitHub Actions CI workflow (Ubuntu & macOS)
│       └── release.yaml           # Automated PyPI & GitHub Release workflow
├── assets/
│   └── Clownfish.icns             # Multi-resolution macOS application icon
├── docs/
│   ├── architecture.md            # Architecture overview & data flow
│   ├── modern-terminal-gap-analysis.md # Modern terminal specifications
│   └── shortcuts.md               # Keybinding reference
├── packaging/
│   └── homebrew/                  # Homebrew tap formulas & casks
│       ├── Casks/
│       │   └── clownfish.rb
│       └── Formula/
│           └── clownfish.rb
├── scripts/
│   ├── build_macos_app.py         # PyInstaller macOS bundle & zip builder
│   └── publish_homebrew.py        # Homebrew tap release automation
├── src/
│   └── clownfish/
│       ├── __init__.py            # Public API exports & launch function
│       ├── __main__.py            # Module entrypoint (python -m clownfish)
│       ├── config.py              # Configuration dataclasses (TerminalConfig)
│       ├── syntax.py              # Syntax highlighting integration
│       ├── core/                  # Core terminal engine
│       │   ├── models.py          # Data models (Cell, Style, Selection, PromptMarker)
│       │   ├── keyboard.py        # Keystroke encoding & Kitty keyboard protocol
│       │   ├── parser.py          # VT100 / ANSI / OSC escape sequence parser
│       │   ├── screen.py          # Screen buffer, dual grid, autowrap & scrollback
│       │   └── search.py          # In-buffer regex & plain text search engine
│       ├── session/               # Terminal session layer
│       │   ├── session.py         # TerminalSession lifecycle manager
│       │   └── transport.py       # Abstract Transport base class
│       ├── transports/            # Pluggable I/O transports
│       │   ├── pty.py             # POSIX PTYTransport with write buffering
│       │   └── ssh.py             # SSHTransport via OpenSSH PTY bridge
│       └── frontends/
│           └── tkinter/           # Tkinter desktop frontend
│               ├── app.py         # TkTerminalApp main window & menu shortcuts
│               ├── pane.py        # TerminalPane self-contained terminal widget
│               ├── split.py       # SplitView arbitrary nested split pane manager
│               ├── tabs.py        # TabbedTerminalView multi-tab session manager
│               ├── renderer.py    # Canvas text & selection renderer
│               └── input.py       # Pointer & keyboard event translator
├── tests/                         # Comprehensive unit & integration test suite
├── pyproject.toml                 # Project metadata & build settings
└── README.md

Roadmap

  • Split-pane multiplexing and tabbed sessions.
  • In-buffer regex / plain text search with highlight overlay.
  • GPU-accelerated texture atlas rendering via Metal/Vulkan.
  • HarfBuzz typography shaping for developer font ligatures (->, !=, ===).
  • Kitty Graphics Protocol inline image streaming.
  • Sixel bitmap rasterization protocol support.

License

This project is licensed under the MIT License.

Metadata

Release files for clownfish 0.5.0

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

Source distribution (sdist)

Source distribution for clownfish 0.5.0
File Size Uploaded Provenance Actions
clownfish-0.5.0.tar.gz 799.9 kB With provenance Details for clownfish-0.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / clownfish-0.5.0.tar.gz

Download URL clownfish-0.5.0.tar.gz
Size 799.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eddb7e0b8a22f23ebe91d38e13c6d1ca1641641d3cecf9e114d1eacc1481bb17
BLAKE2b-256 checksum
How to use checksums
8e36addde5b53f10bdd3bd4896410dd0dbbe0f20a14e31815fca81adcc2195a5
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 17, 2026.

Transparency log

Release files / clownfish-0.5.0-py3-none-any.whl

Download URL clownfish-0.5.0-py3-none-any.whl
Size 806.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a557d7c526a11501ababc645accafc901aa046dc778a6f260ecb6c0e7a0ee9f5
BLAKE2b-256 checksum
How to use checksums
752a8577719cf5cf3e454cdba89f2f61c19b4aaf614d007936b7aba9c1e0fe7b
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 17, 2026.

Transparency log

Security for clownfish 0.5.0

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 clownfish-0.5.0.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 17, 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