Skip to content

fix: improve UX, security, and iTerm2 compatibility#6

Merged
CCALITA merged 1 commit intomainfrom
fix/ux-and-iterm2-compatibility
Apr 16, 2026
Merged

fix: improve UX, security, and iTerm2 compatibility#6
CCALITA merged 1 commit intomainfrom
fix/ux-and-iterm2-compatibility

Conversation

@CCALITA
Copy link
Copy Markdown
Owner

@CCALITA CCALITA commented Apr 16, 2026

Summary

  • Security: Mask API key input during inline-cli setup with term.ReadPassword()
  • UX: Fix error color (yellow→red), eliminate double error display, add NO_COLOR support, unify success formatting, improve root help text
  • iTerm2 fix: Replace glamour.WithAutoStyle() OSC 11 query (5s hang) with env-var-based style detection
  • iTerm2 fix: Enable kitty keyboard protocol in zsh zle-line-init/zle-line-finish hooks so Shift+Enter works automatically in iTerm2 3.5+, kitty, WezTerm, foot, Ghostty
  • Reliability: Replace daemon start 200ms sleep with exponential-backoff socket polling (3s timeout)
  • Docs: Fix README terminal support claims to match actual behavior

Test plan

  • go build ./... passes
  • go test -race ./... passes (including new isDarkFromCOLORFGBG and no-hang tests)
  • go vet ./... clean
  • iTerm2 (zsh): Shift+Enter works without terminal config
  • Ghostty (zsh): Shift+Enter still works (regression check)
  • Terminal.app: Ctrl+J works, no garbage from protocol push
  • NO_COLOR=1 inline-cli query ... produces no ANSI escapes
  • First query responds within 1s (no 5-second glamour hang)

Santa Method review identified and fixed user interaction issues:

- Mask API key input with term.ReadPassword() during setup
- Fix error color from yellow to red, eliminate double error display
- Add NO_COLOR/TERM=dumb/non-tty detection for all ANSI output
- Replace 200ms daemon start sleep with exponential-backoff socket polling
- Add root command Long help text explaining primary usage pattern
- Pass detected terminal width to markdown renderer
- Unify success message formatting with render.Green()/render.Red()

Fix iTerm2 (and other terminal) compatibility:

- Replace glamour.WithAutoStyle() which sends an OSC 11 query that
  blocks for 5 seconds when the terminal doesn't respond. Use
  GLAMOUR_STYLE/COLORFGBG env vars instead, defaulting to dark.
- Enable kitty keyboard protocol in zle-line-init/zle-line-finish
  hooks so Shift+Enter works automatically in iTerm2 3.5+, kitty,
  WezTerm, foot, and Ghostty without manual terminal configuration.
- Fix README to accurately describe terminal support (was claiming
  auto-detection that didn't exist).
@CCALITA CCALITA merged commit 691d4a1 into main Apr 16, 2026
@CCALITA CCALITA deleted the fix/ux-and-iterm2-compatibility branch April 16, 2026 06:03
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