Skip to content

feat: add browser-based terminal with persistent sessions#1279

Open
vic4hub wants to merge 7 commits intoagent0ai:developmentfrom
vic4hub:feature/browser-terminal
Open

feat: add browser-based terminal with persistent sessions#1279
vic4hub wants to merge 7 commits intoagent0ai:developmentfrom
vic4hub:feature/browser-terminal

Conversation

@vic4hub
Copy link

@vic4hub vic4hub commented Mar 17, 2026

Adds a fully-featured xterm.js terminal to the Agent Zero web UI. Terminal sessions survive page refresh — running processes (htop, nano, Claude Code, long-running scripts) reattach automatically.

Features:

  • Multi-tab terminal with rename, close, persist across refreshes
  • Session persistence: shell survives browser refresh/disconnect
  • Full TUI support: htop, nano, vim reattach with correct redraws
  • Mouse interaction restored after reattach for mouse-aware apps
  • Proper PTY session leadership (setsid + TIOCSCTTY) for correct SIGWINCH
  • Theme-aware: honors dark/light mode CSS variables
  • Cross-browser: tested Chrome and Safari

New files:

  • python/helpers/tty_session.py: async PTY wrapper with resize + setsid
  • python/websocket_handlers/terminal_handler.py: WebSocket handler
  • webui/components/terminal/terminal.html: xterm.js UI
  • webui/js/terminal-store.js: Alpine.js tab/session store
  • webui/vendor/xterm/: xterm.js v5.3.0 + fit/canvas/web-links addons

Modified files:

  • webui/index.html: xterm scripts, terminal panel, hide chat when open
  • webui/index.css: terminal tab styling
  • webui/js/initFw.js: import terminal store before Alpine
  • webui/components/sidebar/top-section/quick-actions.html: terminal button

Closes #1136

3clyp50 and others added 7 commits February 10, 2026 21:06
docs updates, typos and fixes for v0.9.8.x
Adds a fully-featured xterm.js terminal to the Agent Zero web UI.
Terminal sessions survive page refresh — running processes (htop, nano,
Claude Code, long-running scripts) reattach automatically.

Features:
- Multi-tab terminal with rename, close, persist across refreshes
- Session persistence: shell survives browser refresh/disconnect
- Full TUI support: htop, nano, vim reattach with correct redraws
- Mouse interaction restored after reattach for mouse-aware apps
- Proper PTY session leadership (setsid + TIOCSCTTY) for correct SIGWINCH
- Theme-aware: honors dark/light mode CSS variables
- Cross-browser: tested Chrome and Safari

New files:
- python/helpers/tty_session.py: async PTY wrapper with resize + setsid
- python/websocket_handlers/terminal_handler.py: WebSocket handler
- webui/components/terminal/terminal.html: xterm.js UI
- webui/js/terminal-store.js: Alpine.js tab/session store
- webui/vendor/xterm/: xterm.js v5.3.0 + fit/canvas/web-links addons

Modified files:
- webui/index.html: xterm scripts, terminal panel, hide chat when open
- webui/index.css: terminal tab styling
- webui/js/initFw.js: import terminal store before Alpine
- webui/components/sidebar/top-section/quick-actions.html: terminal button

Closes agent0ai#1136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants