facts: trim sassy closing lines - #116
Conversation
There was a problem hiding this comment.
Caution
Changes requested ❌ — 1 issue
Reviewed 9908e0f in 11 minutes, 6 seconds.
- Reviewed
2commits with330lines of code in6files - Ran
1review agent producing1comment where1was posted - This pipeline runs no gatekeeper, so findings are posted as written.
- View full details on ellipsis.dev
This review was created by . You can tag
@ellipsis in this pull request.
| const onData = (chunk: Buffer): void => { | ||
| buffer += chunk.toString('latin1') | ||
| const mode = modeFromOscReply(buffer) | ||
| if (mode) finish(mode) | ||
| else if (buffer.length > 64) finish(null) | ||
| } | ||
| const timer = setTimeout(() => finish(null), timeoutMs) | ||
| stdin.setRawMode(true) | ||
| stdin.resume() | ||
| stdin.on('data', onData) | ||
| stdout.write('\x1b]11;?\x1b\\') |
There was a problem hiding this comment.
An OSC 11 reply that arrives after the 200ms timeout is typed into the composer: finish(null) detaches the listener but leaves the bytes in the stream, and Ink's readable-based reader picks them up as keyboard input.
Verified on a paused PassThrough that a chunk written after off('data') + pause() is delivered to a later on('readable') reader, and against ink@7.1.1's parser: \x1b]11;rgb:2222/2222/2222\x1b\\ parses to three input events, the middle one the literal string 11;rgb:2222/2222/2222, which ConnectApp's useInput falls through to insertAtCursor. 200ms is an ordinary round trip over SSH, so the first frame opens with junk in the input box. The same window also drops any keystroke the user types during detection — buffer is discarded on finish. A grace-period drain won't fix it cleanly (it keeps eating typeahead); the usual fix is to chase the query with a DA1 (\x1b[c) sync marker and only give up once DA1's reply comes back, so a late OSC 11 reply cannot exist.
Important
Trims sassy closing lines from facts and adds automatic light/dark theme detection based on terminal background.
terminalBackground.ts: queries via OSC 11, falls back toCOLORFGBGenv var, defaults to dark mode.theme.tsto support both light and dark palettes;applyThemeMode()mutates the livethemeobject in place so existing import sites follow without plumbing changes.connect.tsandlaunch.tsxbefore the first UI render, so no palette mismatch ever appears on screen.This description was created by
for 9908e0f. It will automatically update as commits are pushed.