Skip to content

fix: swallow the browser chords Shift was still letting through - #108

Merged
omartelo merged 1 commit into
mainfrom
fix/shifted-browser-chords
Jul 27, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/shifted-browser-chords

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

#99 taught the --app window to stop behaving like a browser, but the shifted
list was enumerated from the tab and window commands plus the browsing-data
wipe (t w n m delete) and stopped there. Shift became a way past the refusal
rather than part of it:

  • Ctrl+Shift+P — p was refused unshifted, and still raised the system
    print dialog with Shift held. This is the one that turned up in testing.
  • Ctrl+Shift+O — same shape: o refused, bookmark manager still opened.
  • Ctrl+Shift+Q — exits Chromium, which quits lich, exactly the fatal move
    Ctrl+W was already stopped from making.

They fired on every screen, a focused terminal included: xterm only
preventDefaults the chords it encodes as a PTY sequence, and none of these
are one, so the window listener was the only thing that could have claimed
them.

Kept live on purpose: the devtools chords (Ctrl+Shift+I/J/C), reload, F11, and
now-confirmed Ctrl+Shift+B and Ctrl+Shift+A — an --app window has no
bookmarks bar and no tabstrip, so both are no-ops here.

Test plan

  • browser-defaults.test.ts covers the three new keys in the shifted case;
    the devtools-chords assertion still pins Ctrl+Shift+I/J/C as untouched.
  • vitest run — 468 passed (45 files).
  • biome check clean, tsc --noEmit clean.
  • Ctrl+Shift+A and Ctrl+Shift+B exercised by hand in the real window —
    nothing appeared.
  • Ctrl+Shift+P / O / Q by hand in the packaged window, terminal focused and
    not.

The shifted list was enumerated from the tab and window commands, plus
the browsing-data wipe, and stopped there — so Shift became a way past
the refusal rather than part of it. Ctrl+P was refused while
Ctrl+Shift+P still raised the system print dialog, Ctrl+O while
Ctrl+Shift+O still opened the bookmark manager, and Ctrl+Shift+Q exited
Chromium outright, which quits lich exactly as Ctrl+W did before #99
stopped it.

Shift does not make a chord harmless; it only changes which surface
opens. They fired on every screen, a focused terminal included, since
xterm only preventDefaults the chords it encodes as a PTY sequence and
none of these are one.

Ctrl+Shift+B and Ctrl+Shift+A are deliberately still live: an --app
window has no bookmarks bar and no tabstrip, so both are no-ops here,
confirmed by hand.
@omartelo
omartelo merged commit 26825fb into main Jul 27, 2026
3 checks passed
@omartelo
omartelo deleted the fix/shifted-browser-chords branch July 27, 2026 18:10
@omartelo omartelo mentioned this pull request Jul 27, 2026
6 tasks done
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