Skip to content

Fix terminal startup and add browser context for CLI agents#1

Open
theahura wants to merge 1 commit into
mainfrom
auto/fix-terminal-cursor-position-error-20260605-213945
Open

Fix terminal startup and add browser context for CLI agents#1
theahura wants to merge 1 commit into
mainfrom
auto/fix-terminal-cursor-position-error-20260605-213945

Conversation

@theahura

@theahura theahura commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

🤖 Generated with Nori

  • Fix crossterm "cursor position could not be read" crash by intercepting ESC[6n in the PTY data handler and responding immediately, bypassing the slow IPC round-trip through xterm.js
  • Defer PTY spawn until the renderer signals xterm.js is initialized (terminal-ready IPC), with a 10s timeout fallback
  • Create per-session working directories at ~/nori-browser/YYYYMMDD-HHMMSS/ instead of starting in $HOME
  • Pass Playwright browser context (CDP connection info + usage examples) to nori (-c developer_instructions=...) and claude (--append-system-prompt ...) CLIs so the agent knows about the browser from startup

Test Plan

  • Verify npm test passes (12 tests including 2 new ones)
  • Run npm run start and confirm the terminal sidebar loads without crashing
  • Verify the terminal starts in a ~/nori-browser/YYYYMMDD-HHMMSS/ directory
  • If nori/claude is on PATH, verify the agent mentions browser access capabilities

Share Nori with your team: https://www.npmjs.com/package/nori-skillsets

…ser context

The terminal sidebar crashed on startup because Rust CLIs (nori/claude) use
crossterm's cursor position query (ESC[6n), which timed out waiting for the
response to round-trip through the IPC to xterm.js and back.

Three fixes:
- Intercept ESC[6n in PTY data handler, respond immediately with ESC[1;1R
- Defer PTY spawn until renderer signals xterm.js is ready (terminal-ready IPC)
- Create per-session working directory at ~/nori-browser/YYYYMMDD-HHMMSS/
- Pass browser context (Playwright CDP connection info) as CLI args to nori/claude
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
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.

1 participant