Clownfish 🐟
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
- Remote SSH Sessions & Integrated Client: Direct CLI connection via
clownfish ssh [user@]host [-p port] [-i key], UI Quick Connect dialog (Cmd+Shift+O/Ctrl+Shift+O), visual remote tab indicators (🌐 user@host), and clean connection teardown. - Session Layout Persistence & Restoration: Automatically serializes open tabs, nested split hierarchies (horizontal and vertical), and working directories across restarts into
~/.config/clownfish/session_state.json(--restore/--no-restore). - Headless Terminal Interface: Pure Python programmatic interface (
HeadlessTerminal) with zero display-server/Tkinter requirements, ideal for CI, AI agent automation, and scripted testing (get_text(),wait_for_text(),send_input()). - Split Navigation & Desktop Ergonomics: Fast split pane keyboard cycling (
Cmd+[/Cmd+]orAlt+[/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 9andOSC 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
precmdwindow and tab title sequences (OSC 0andOSC 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) orCtrl+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 likeShift+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+ClickorCtrl+Click. - Mouse Tracking: Normal tracking (
?1000h) and SGR decimal tracking (?1006h) for interactive CLI programs likevim,htop, andtmux. - 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:
- Download
Clownfish-v0.6.3-macos.zip. - Unzip the archive:
unzip Clownfish-v0.6.3-macos.zip - Move
Clownfish.appto/Applications:mv Clownfish.app /Applications/
- 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
- Architecture Guide: Deep dive into screen buffer management, parser state machine, and render loop.
- Modern Terminal Gap Analysis: Technical analysis of the fundamental features required for modern terminal emulators.
- Keyboard & Mouse Shortcuts: Guide to shortcuts for clearing buffers, navigation, and clipboard operations.
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.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clownfish-0.6.3.tar.gz | 811.7 kB | With provenance | Details for clownfish-0.6.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clownfish-0.6.3-py3-none-any.whl | Python 3 | none | any | Details for clownfish-0.6.3-py3-none-any.whl |
Total release size: 1.6 MB
Release files / clownfish-0.6.3.tar.gz
| Download URL | clownfish-0.6.3.tar.gz |
|---|---|
| Size | 811.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c605aca0182afb772877bd1851177ddb5ee4e627ffdbc9b92561833eaf235d9
|
|
BLAKE2b-256 checksum How to use checksums |
81869b7677cc2ba50e316859e71cf9da1de87bc9f729851636e148552a552b5a
|
| 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 22, 2026.
Transparency logRelease files / clownfish-0.6.3-py3-none-any.whl
| Download URL | clownfish-0.6.3-py3-none-any.whl |
|---|---|
| Size | 819.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebbb90b324bcac0e2566a25c66698fbf2bf036572017f454e9a1258e4bf37993
|
|
BLAKE2b-256 checksum How to use checksums |
a971d3474e07b5bd477c5eea3017eca7d3cdcba1315fb0357c4ea07cd8e8d095
|
| 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 22, 2026.
Transparency logSecurity for clownfish 0.6.3
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.
Attestation for clownfish-0.6.3.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 22, 2026.
Transparency logA 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.