Skip to content

Add agent host xterm/headless #315407

Draft
anthonykim1 wants to merge 1 commit intomainfrom
anthonykim1/firstXtermHeadless
Draft

Add agent host xterm/headless #315407
anthonykim1 wants to merge 1 commit intomainfrom
anthonykim1/firstXtermHeadless

Conversation

@anthonykim1
Copy link
Copy Markdown
Contributor

No description provided.

@anthonykim1 anthonykim1 self-assigned this May 8, 2026
Copilot AI review requested due to automatic review settings May 8, 2026 23:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a headless xterm.js-backed terminal mirror inside the Agent Host so the PTY can receive terminal-state query responses (eg cursor position reports) even when no UI terminal is attached.

Changes:

  • Introduces AgentHostHeadlessTerminal, a small wrapper around @xterm/headless that mirrors PTY output and forwards only cursor-position responses.
  • Wires the headless terminal into AgentHostTerminalManager to feed PTY output into the mirror and write approved responses back to the PTY.
  • Adds unit tests covering DSR/DEC DSR responses, filtering, resize/clear behavior, and resilience to write failures.
Show a summary per file
File Description
src/vs/platform/agentHost/test/node/agentHostHeadlessTerminal.test.ts New unit tests for the headless terminal mirror’s response forwarding and state updates.
src/vs/platform/agentHost/node/agentHostTerminalManager.ts Instantiates and integrates the headless terminal mirror per managed PTY, including resize/clear propagation.
src/vs/platform/agentHost/node/agentHostHeadlessTerminal.ts New headless xterm-based mirror that emits filtered response data for terminal-state queries.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines 293 to +327
@@ -304,9 +313,18 @@ export class AgentHostTerminalManager extends Disposable implements IAgentHostTe
contentSize: 0,
claim,
commandTracker,
headlessTerminal,
};

this._terminals.set(uri, managed);
store.add(headlessTerminal.onResponseData(data => {
this._logService.debug(`[TerminalManager] Writing headless terminal response for ${uri}: ${JSON.stringify(data)}`);
try {
ptyProcess.write(data);
} catch (err) {
this._logService.debug(`[TerminalManager] Failed to write headless terminal response for ${uri}: ${err instanceof Error ? err.message : String(err)}`);
}
}));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should cover test.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

blocks-ci screenshots changed

Replace the contents of test/componentFixtures/blocks-ci-screenshots.md with:

Updated blocks-ci-screenshots.md
<!-- auto-generated by CI — do not edit manually -->

#### editor/codeEditor/CodeEditor/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/67bfb687fd2818bd53771a60660541b9ed6f38b80d37da0aac15d267ecaeacec)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/0469dd8d0a587d94a1eaec514c79917b93b9a38694ef2b767bb1892819ae0a55)

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/97162fc53c861ee13dc78a18e41fe3a25a42f62dc52a560510ebf084a418e1c3)

#### editor/inlineChatZoneWidget/InlineChatZoneWidget/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/3b7e2eb5cc9ba727e2bc1c5113c3e17d8e9a6ce9a37b77519be3716ceb9a9afa)

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/97162fc53c861ee13dc78a18e41fe3a25a42f62dc52a560510ebf084a418e1c3)

#### editor/inlineChatZoneWidget/InlineChatZoneWidgetTerminated/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/3b7e2eb5cc9ba727e2bc1c5113c3e17d8e9a6ce9a37b77519be3716ceb9a9afa)

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants