Skip to content

facts: trim sassy closing lines - #116

Merged
hbrooks merged 2 commits into
mainfrom
remove-sassy-facts
Aug 20, 2026
Merged

facts: trim sassy closing lines#116
hbrooks merged 2 commits into
mainfrom
remove-sassy-facts

Conversation

@hbrooks

@hbrooks hbrooks commented Aug 20, 2026

Copy link
Copy Markdown
Member

Important

Trims sassy closing lines from facts and adds automatic light/dark theme detection based on terminal background.

  • Removes flavor text from 10 facts (e.g., "Your terminal prompt is using more memory than the moon landing did") to make them more straightforward.
  • Adds terminal background detection in terminalBackground.ts: queries via OSC 11, falls back to COLORFGBG env var, defaults to dark mode.
  • Refactors theme.ts to support both light and dark palettes; applyThemeMode() mutates the live theme object in place so existing import sites follow without plumbing changes.
  • Applies the detected theme once at startup in connect.ts and launch.tsx before the first UI render, so no palette mismatch ever appears on screen.

This description was created by Ellipsis for 9908e0f. It will automatically update as commits are pushed.

@hbrooks
hbrooks merged commit a38afd9 into main Aug 20, 2026
1 check passed

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Changes requested ❌ — 1 issue

Reviewed 9908e0f in 11 minutes, 6 seconds.
  • Reviewed 2 commits with 330 lines of code in 6 files
  • Ran 1 review agent producing 1 comment where 1 was posted
  • This pipeline runs no gatekeeper, so findings are posted as written.
  • View full details on ellipsis.dev

This review was created by Ellipsis. You can tag @ellipsis in this pull request.

Comment on lines +64 to +74
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\\')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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