Skip to content

Fix terminal color report routing - #479

Open
Misaka (chuxubank) wants to merge 1 commit into
microsoft:mainfrom
chuxubank:fix/route-terminal-color-reports
Open

Misaka (chuxubank) wants to merge 1 commit into
microsoft:mainfrom
chuxubank:fix/route-terminal-color-reports

Conversation

@chuxubank

Copy link
Copy Markdown

Summary

Route dynamic terminal color reports (OSC 10/11/12) back to the child PTY instead of treating them as shell keypresses.

Programs such as chezmoi query the terminal background with OSC 11;?. Inside an inshellisense session, the query reaches the host terminal, but its OSC 11;rgb:... response currently enters readline as user input and is printed at the prompt.

Changes

  • track pending OSC 10/11/12 queries in ISTerm, alongside the existing cursor-position query tracking
  • parse BEL- and ST-terminated color reports from host terminal input
  • forward reports only when the child issued the matching selector query
  • keep incomplete reports across input chunks and preserve unrelated input
  • add unit coverage for both terminators, chunking, trailing input, and unrelated OSC sequences

Validation

  • npm run lint
  • npm test -- --runInBand — 207 passed, 10 skipped
  • npm run build
  • targeted test and TypeScript build under the CI Node version (22.21.1)

npm run test:e2e -- --runInBand did not complete in the local nested inshellisense environment and was stopped after 30 minutes; the cross-platform GitHub Actions matrix should provide the authoritative E2E result.

@chuxubank

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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