feat: kitty-compatible keybindings via tmux extended-keys (CSI u)

All Ctrl+Shift shortcuts mapped to match kitty defaults:
- Ctrl+Shift+T/W/Left/Right for tab management
- Ctrl+Shift+Enter for splits, ]/[ for pane cycling
- Ctrl+Shift+C/V for copy/paste, H for scrollback pager
- Ctrl+Shift+1-9 for goto tab, F11 for fullscreen
- Dvorak extras and Alt shortcuts preserved alongside
This commit is contained in:
Mortdecai
2026-03-26 19:18:56 -04:00
parent 8d075f2b48
commit d1eea4f26a
2 changed files with 163 additions and 82 deletions
+73 -63
View File
@@ -1,16 +1,84 @@
# 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.
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
- **Mobile touch toolbar** — on-screen buttons for tabs, signals, navigation, splits, and text selection
- **Text selection mode** — tap `Sel` to select and copy text on touch devices
- **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
```
@@ -29,6 +97,7 @@ 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
@@ -37,46 +106,6 @@ sudo systemctl daemon-reload
sudo systemctl enable --now sethmux sethmux-notify
```
Open `http://YOUR_IP:7683` in a browser.
## Mobile Toolbar
Appears on screens < 900px. Buttons:
| Button | Action | tmux Key |
|--------|--------|----------|
| **+Tab** | New tab | `Ctrl-A c` |
| **Next/Prev** | Switch tabs | `Ctrl-A n/p` |
| **^C / ^D / Clr** | Interrupt / EOF / Clear | |
| **Esc / Tab / Up / Down** | Navigation | |
| **Sel** | Text selection mode | |
| **V.Spl** | Split vertical | `Ctrl-A v` |
| **H.Spl** | Split horizontal | `Ctrl-A s` |
| **Pane** | Cycle panes | `Ctrl-A o` |
| **Kill** | Kill pane/tab | `Ctrl-A x` |
## Push Notifications
```bash
sethmux-notify "Deploy complete!"
echo "done" | sethmux-notify
make build && sethmux-notify "OK" || sethmux-notify "FAIL"
```
## tmux Keybindings
Prefix: `Ctrl-A` (not the default Ctrl-B — easier on mobile).
| Key | Action |
|-----|--------|
| `Ctrl-A c` | New window |
| `Ctrl-A n / p` | Next / previous |
| `Ctrl-A v / s` | Split vertical / horizontal (Dvorak home row) |
| `Ctrl-A o` | Cycle panes |
| `Ctrl-A x` | Kill pane |
| `Alt-1` to `Alt-5` | Jump to window |
| Mouse scroll | History |
## Reverse Proxy (Caddy)
```
@@ -90,25 +119,6 @@ mux.example.com {
}
```
## Files
```
sethmux/
static/
index.html # Custom ttyd page with toolbar injection
toolbar.js # Mobile touch toolbar
manifest.json # PWA manifest
icon-192.png # PWA icon
icon-512.png # PWA icon
config/
tmux.conf # Sethian-themed tmux config
systemd/
sethmux.service # ttyd + tmux systemd unit
sethmux-notify.service # Notification API unit
notify-server.py # Push notification HTTP API
sethmux-notify # CLI notification command
```
## License
MIT