Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ button to point the app at a different server.

| Shortcut | Action |
|---|---|
| `Ctrl/Cmd+K` | Command palette |
| `Ctrl/Cmd+Shift+K` | Command palette (bare Ctrl+K is the browser's own search shortcut and never reaches the page) |
| `Ctrl/Cmd+B` | Show or hide the Places rail (desktop) |
| `Ctrl/Cmd+Shift+T` | New terminal session |
| `Ctrl/Cmd+Shift+W` | Close active tab |
Expand Down
4 changes: 2 additions & 2 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ const App: Component = () => {
«
</button>
</div>
<button type="button" class="rail-go-to" title="Go to… (Ctrl/Cmd+K)" onClick={() => setCommandPaletteOpen(true)}>Go to…</button>
<button type="button" class="rail-go-to" title="Go to… (Ctrl/Cmd+Shift+K)" onClick={() => setCommandPaletteOpen(true)}>Go to…</button>
{/* B1: a pointer, not a second WaitingSession. Outage wins ties over
a waiting session; "running" never earns a card. Click routes to
the one waiting session's own terminal, or to Sessions when
Expand Down Expand Up @@ -2071,7 +2071,7 @@ const App: Component = () => {
with no header of its own: a route outcome (loading, not found,
unavailable). */}
<Show when={routeProblem()}>
<button type="button" class="mobile-go-to" title="Go to… (Ctrl/Cmd+K)" onClick={() => setCommandPaletteOpen(true)}>
<button type="button" class="mobile-go-to" title="Go to… (Ctrl/Cmd+Shift+K)" onClick={() => setCommandPaletteOpen(true)}>
Go to…
</button>
</Show>
Expand Down
2 changes: 1 addition & 1 deletion web/src/GoToButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const GoToButton: Component<{ class?: string }> = (props) => {
type="button"
class={`go-to-inline${props.class ? ` ${props.class}` : ""}`}
aria-label="Go to… (command palette)"
title="Go to… (Ctrl/Cmd+K)"
title="Go to… (Ctrl/Cmd+Shift+K)"
onClick={() => actions().openCommandPalette()}
>
<svg viewBox="0 0 24 24" aria-hidden="true">
Expand Down
5 changes: 4 additions & 1 deletion web/src/__tests__/keyboardShortcuts.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ describe("the declared shortcut registry", () => {
it("still matches the declared global palette binding from an input", () => {
const input = document.createElement("input");
document.body.append(input);
expect(matchedFrom(input, { key: "k", ctrlKey: true })?.id).toBe(
expect(matchedFrom(input, { key: "k", ctrlKey: true, shiftKey: true })?.id).toBe(
"open-command-palette",
);
// Bare Ctrl+K is Firefox's "Search the web" and is never delivered to the
// page, so it must not be the binding.
expect(matchedFrom(input, { key: "k", ctrlKey: true })).toBeUndefined();
input.remove();
});
});
9 changes: 7 additions & 2 deletions web/src/keyboardShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ export interface KeyboardShortcut {
export const KEYBOARD_SHORTCUTS: readonly KeyboardShortcut[] = [
{
id: "open-command-palette",
keys: ["Ctrl/Cmd", "K"],
// Shift is load-bearing. Firefox claims bare Ctrl+K ("Search the web") in
// its own shortcut layer and never delivers the keydown to the page, so
// preventDefault on the bubble listener cannot win it. Ctrl/Cmd+Shift+K is
// not reserved there (or by Chrome's omnibox Ctrl+K) and still reaches a
// focused terminal, because xterm only claims unmodified Ctrl+letter.
keys: ["Ctrl/Cmd", "Shift", "K"],
description: "Open command palette",
category: "Navigation",
context: "global",
contextLabel: "Anywhere",
binding: { key: "k", ctrlOrMeta: true, alt: false, shift: false },
binding: { key: "k", ctrlOrMeta: true, alt: false, shift: true },
},
{
id: "new-terminal-session",
Expand Down
Loading