docs: add ttyd dual-interface plan to TUI roadmap

Plan to expose both OpenCode IDE (port 8080) and raw ttyd terminal
(port 7681) for direct TUI access in browser.
This commit is contained in:
Oussama Douhou
2026-01-10 22:55:07 +01:00
parent 2fcf4d6bd4
commit e0b09bc5c0

View File

@@ -48,24 +48,36 @@
**Goal**: Enable rich terminal UI applications (like htop, lazygit, OpenCode TUI mode) to render correctly in the browser-based terminal.
**Completed**:
**Completed** (Terminal Environment):
- [x] TERM=xterm-256color environment variable
- [x] COLORTERM=truecolor for 24-bit color support
- [x] ncurses-base and ncurses-term packages for terminfo database
- [x] Locale configuration (en_US.UTF-8) for Unicode support
- [x] Environment variables passed to deployed stacks
**Remaining**:
- [ ] Test TUI applications in browser (htop, lazygit, vim)
- [ ] Verify mouse event passthrough works
- [ ] Test box-drawing character rendering
**Remaining** (Direct Web Terminal):
- [ ] Add ttyd for raw terminal access in browser
- [ ] Configure dual-port exposure (OpenCode IDE + ttyd terminal)
- [ ] Update Traefik routing for terminal port
- [ ] Test TUI applications (htop, lazygit, vim)
- [ ] Document TUI capabilities for users
**Technical Notes**:
- OpenCode uses built-in xterm.js web terminal
- Terminal environment configured in Docker image + deployer
- 256 colors verified working (tput colors = 256)
- 104 xterm terminfo entries installed
**Architecture** (Dual Interface):
```
https://name.ai.flexinit.nl/ → Port 8080 → OpenCode Web IDE
https://name.ai.flexinit.nl:7681/ → Port 7681 → ttyd Raw Terminal
```
**Implementation Plan**:
```dockerfile
# Add ttyd to Dockerfile
RUN curl -sL https://github.com/tsl0922/ttyd/releases/latest/download/ttyd.x86_64 \
-o /usr/local/bin/ttyd && chmod +x /usr/local/bin/ttyd
# Startup script runs both services
ttyd -p 7681 -W bash &
opencode serve --hostname 0.0.0.0 --port 8080
```
**Use Cases**:
- OpenCode TUI mode in browser