hardware/mac-studio/ttyd.md
Table of Contents
Mac Studio — ttyd (Web Terminal)
ttyd shares a terminal over the web. Lighter alternative to code-server.
Served at term.dph.am via nginx proxy (see services/nginx-auth-service.md).
- Local URL: http://localhost:8080
- Proxy URL: https://term.dph.am (behind nginx auth)
- Internal port:
8080 - External port (nginx):
8089 - Log:
~/Library/Logs/ttyd.log - Theme: Dark (
#0e0e1ebg,#cdd6f4fg)
Stack
ttyd -W → tmux new -A -s web → shell (persistent tmux session)
Manage
Start / stop is via launchd:
launchctl load ~/Library/LaunchAgents/com.user.ttyd.plist # start
launchctl unload ~/Library/LaunchAgents/com.user.ttyd.plist # stop
launchctl list com.user.ttyd # check if running
Auto-starts on login and auto-restarts if it crashes.
Quick Config Override
Add query params to the URL (no restart needed):
http://localhost:8080/?fontSize=20&fontFamily=JetBrains%20Mono
All xterm.js ITerminalOptions are supported this way — cursorStyle, lineHeight, theme, etc.
The Plist
~/Library/LaunchAgents/com.user.ttyd.plist — full ProgramArguments:
| Argument | Value |
|---|---|
-t fontSize=16 |
Font size in px |
-t lineHeight=1 |
Line height |
-t fontFamily=... |
JetBrains Mono, Fira Code, monospace |
-t theme=... |
{"background": "#0e0e1e", "foreground": "#cdd6f4"} |
| Command | tmux new -A -s web |
Interactive Shortcut
Also defined in ~/.extras.bash for when you want to run it manually:
start_ttyd() {
ttyd -W -p 8080 \
-t fontSize=16 \
-t lineHeight=1 \
-t fontFamily="JetBrains Mono, Fira Code, monospace" \
-t 'theme={"background": "#0e0e1e", "foreground": "#cdd6f4"}' \
tmux new -A -s web
}