From e0b09bc5c0cb70d054c6beda75786b82c3ccb4df Mon Sep 17 00:00:00 2001 From: Oussama Douhou Date: Sat, 10 Jan 2026 22:55:07 +0100 Subject: [PATCH] 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. --- ROADMAP.md | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 4057935..631edd0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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