# sethmux Mobile-first web terminal powered by [ttyd](https://github.com/tsl0922/ttyd) + [tmux](https://github.com/tmux/tmux). One persistent session, multiple tabs, accessible from any browser. Kitty-compatible keybindings. ## Features - **Single persistent tmux session** — shared across all connected clients, live-synced across devices - **Kitty keybindings** — `Ctrl+Shift+T/W/Left/Right` etc. via tmux extended-keys (CSI u) - **Mobile touch toolbar** — two-row on-screen buttons for all common actions - **AI CLI optimized** — 200K scrollback, pane capture/logging, pre-built session layout - **Push notifications** — `sethmux-notify "Build done!"` sends browser notifications - **PWA installable** — add to home screen for app-like experience - **Dark theme** — Sethian dark + orange (#D35400) accent ## Keybindings ### Kitty-compatible (Ctrl+Shift+key) | Key | Action | |-----|--------| | `Ctrl+Shift+T` | New tab | | `Ctrl+Shift+W` | Close tab | | `Ctrl+Shift+Right/Left` | Next / previous tab | | `Ctrl+Shift+1-9` | Go to tab N | | `Ctrl+Shift+. / ,` | Move tab forward / backward | | `Ctrl+Shift+Enter` | New split (horizontal) | | `Ctrl+Shift+] / [` | Next / previous pane | | `Ctrl+Shift+L` | Cycle layouts | | `Ctrl+Shift+Up/Down` | Scroll up / down | | `Ctrl+Shift+PageUp/PageDown` | Scroll page | | `Ctrl+Shift+Home/End` | Scroll to top / bottom | | `Ctrl+Shift+H` | Show scrollback in pager | | `Ctrl+Shift+C` | Enter copy mode (vi-style) | | `Ctrl+Shift+V` | Paste | | `Ctrl+Shift+Delete` | Clear terminal + scrollback | | `F11` | Toggle fullscreen (zoom pane) | ### Dvorak extras (prefix Ctrl-A) | Key | Action | |-----|--------| | `Ctrl-A v / s` | Split vertical / horizontal | | `Ctrl-A S` | Capture pane to `~/logs/` | | `Ctrl-A L` | Toggle live logging to `~/logs/` | | `Ctrl-A z` | Zoom pane | ### Alt shortcuts (no prefix) | Key | Action | |-----|--------| | `Alt-T` | New tab | | `Alt-W` | Close tab | | `Alt-1` to `Alt-5` | Go to tab N | | `Alt-Left/Right` | Previous / next tab | ## Mobile Toolbar Two rows, appears on screens < 900px: **Row 1:** `+Tab` `Next` `Prev` | `^C` `^D` `Clr` | `Esc` `Tab` `▲` `▼` **Row 2:** `Sel` `Paste` `Zoom` `Save` | `V.Spl` `H.Spl` `Pane` `Kill` ## Session Layout On startup, four named windows are created: | Window | Purpose | |--------|---------| | **code** | Main working terminal | | **git** | Git operations | | **run** | Running services / builds | | **logs** | Tailing logs, monitoring | ## Push Notifications ```bash sethmux-notify "Deploy complete!" echo "done" | sethmux-notify make build && sethmux-notify "OK" || sethmux-notify "FAIL" ``` ## Architecture ``` Browser -> Caddy (HTTPS + Auth) -> ttyd (port 7683) -> tmux session "sethmux" -> notify-server (port 7684) -> /api/notifications ``` ## Quick Start ```bash # Dependencies apt install -y tmux curl -sL https://github.com/tsl0922/ttyd/releases/latest/download/ttyd.x86_64 -o /usr/local/bin/ttyd chmod +x /usr/local/bin/ttyd # Deploy sudo mkdir -p /opt/sethmux sudo cp static/* /opt/sethmux/ sudo cp sethmux-start.sh /opt/sethmux/ sudo cp notify-server.py /opt/sethmux/ sudo cp sethmux-notify /usr/local/bin/ sudo cp config/tmux.conf ~/.tmux.conf sudo cp systemd/*.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now sethmux sethmux-notify ``` ## Reverse Proxy (Caddy) ``` mux.example.com { # your auth here handle /toolbar.js { root * /opt/sethmux; file_server } handle /manifest.json { root * /opt/sethmux; file_server } handle /icon-*.png { root * /opt/sethmux; file_server } handle /api/* { uri strip_prefix /api; reverse_proxy localhost:7684 } handle { reverse_proxy localhost:7683 } } ``` ## License MIT