Repository navigation
Port Windows Terminal fixes from upstream (serrebidev) - #5
Merged
Merged
Conversation
Modern command-line windows (cmd, PowerShell, WSL under Windows Terminal) expose their text through a UIA TermControl element rather than the legacy console buffer. Detect that element from the focused object and capture from it directly, so every tab and split pane works regardless of the host window's class name. Also guard currentClassName access, which can raise a COM error and previously aborted the whole review command after the initial beep. Ported from ruifontes#16. Co-Authored-By: serrebidev <serrebi101@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Terminal cells are space-padded to the column width and TUI apps reserve whole rows for borders and status chrome, so a UNIT_STORY capture fills the review window with blank padding and box-drawing-only lines. Strip trailing whitespace per line and drop lines with no real content. Applied to the focused-TermControl capture as well, which the upstream PR predates. Ported from ruifontes#18. Co-Authored-By: serrebidev <serrebi101@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 24, 2026
Closed
This was referenced Aug 24, 2026
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports @serrebidev's Windows Terminal work from the old repo, where it was opened before maintenance moved here. Credited via
Co-Authored-Byon both commits.On Windows 11, cmd/PowerShell/WSL run inside Windows Terminal, which exposes text through a UIA
TermControlrather than the console buffer.control+NVDA+wonly reached it by walking down from the foreground window, so it missed the active tab or split pane, and aborted with no output ifcurrentClassNameraised a COM error mid-walk.The control is now located from the focused object, the class-name check is guarded, and captured text has trailing padding and border-only lines stripped.
Two things worth noting: ruifontes#18 predates ruifontes#16, so it only cleaned the two capture sites in
obtainUWPWindowText()and not the focused-TermControl capture that is now the main path — applied there as well. The legacyConsoleWindowClassbranch keeps its raw.rstrip(), as upstream intended. Every conflict was formatting, not logic.Partly addresses #3: the beep-then-stop in the command prompt is the COM failure now guarded. The PuTTY upward-scroll problem in that issue is separate.
Tested as a
devbuild in a running NVDA against Windows Terminal.