/ utils / keyboardShortcuts.ts
keyboardShortcuts.ts
 1  // Special characters that macOS Option+key produces, mapped to their
 2  // keybinding equivalents. Used to detect Option+key shortcuts on macOS
 3  // terminals that don't have "Option as Meta" enabled.
 4  export const MACOS_OPTION_SPECIAL_CHARS = {
 5    '†': 'alt+t', // Option+T -> thinking toggle
 6    π: 'alt+p', // Option+P -> model picker
 7    ø: 'alt+o', // Option+O -> fast mode
 8  } as const satisfies Record<string, string>
 9  
10  export function isMacosOptionChar(
11    char: string,
12  ): char is keyof typeof MACOS_OPTION_SPECIAL_CHARS {
13    return char in MACOS_OPTION_SPECIAL_CHARS
14  }