Skip to content

workaround windows terminal bug when sending XTVERSION before alt screen#934

Closed
Hona wants to merge 1 commit intomainfrom
fix/query-send-after-alt-screen
Closed

workaround windows terminal bug when sending XTVERSION before alt screen#934
Hona wants to merge 1 commit intomainfrom
fix/query-send-after-alt-screen

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Apr 8, 2026

Summary

  • move startup terminal queries to run after alternate-screen setup
  • avoid the Windows Terminal stall caused by sending XTVERSION before entering alt-screen
  • keep the existing startup detection logic intact and only change ordering

Testing

  • bun run build:native
  • verified locally against the OpenTUI textarea harness, example selector, and OpenCode after loading the patched native build

Closes #933

Copilot AI review requested due to automatic review settings April 8, 2026 02:51
Copy link
Copy Markdown

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

Reorders terminal initialization in the Zig CLI renderer so startup capability queries (notably XTVERSION) are sent only after alternate-screen setup, avoiding a Windows Terminal stall reported in #933 while keeping the existing detection/query logic unchanged.

Changes:

  • Move setupTerminalWithoutDetection(useAlternateScreen) to run before terminal.queryTerminalSend(...)
  • Keep query send and flushing behavior the same, only changing ordering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona changed the title fix: run startup queries after entering alt screen workaround windows terminal bug when sending XTVERSION before alt screen Apr 8, 2026
@Hona
Copy link
Copy Markdown
Member Author

Hona commented Apr 8, 2026

upstream WT has kindly fixed this quickly... won't need this :)

microsoft/terminal#20095

@Hona Hona closed this Apr 8, 2026
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.

Windows Terminal stalls when XTVERSION is sent before alt-screen

2 participants