(onDone: LocalJSXCommandOnDone, context: ToolUseContext & LocalJSXCommandContext, _args: string)
| 140 | } |
| 141 | } |
| 142 | export async function call(onDone: LocalJSXCommandOnDone, context: ToolUseContext & LocalJSXCommandContext, _args: string): Promise<null> { |
| 143 | if (env.terminal && env.terminal in NATIVE_CSIU_TERMINALS) { |
| 144 | const message = `Shift+Enter is natively supported in ${NATIVE_CSIU_TERMINALS[env.terminal]}. |
| 145 | |
| 146 | No configuration needed. Just use Shift+Enter to add newlines.`; |
| 147 | onDone(message); |
| 148 | return null; |
| 149 | } |
| 150 | |
| 151 | // Check if terminal is supported |
| 152 | if (!shouldOfferTerminalSetup()) { |
| 153 | const terminalName = env.terminal || 'your current terminal'; |
| 154 | const currentPlatform = getPlatform(); |
| 155 | |
| 156 | // Build platform-specific terminal suggestions |
| 157 | let platformTerminals = ''; |
| 158 | if (currentPlatform === 'macos') { |
| 159 | platformTerminals = ' • macOS: Apple Terminal\n'; |
| 160 | } else if (currentPlatform === 'windows') { |
| 161 | platformTerminals = ' • Windows: Windows Terminal\n'; |
| 162 | } |
| 163 | // For Linux and other platforms, we don't show native terminal options |
| 164 | // since they're not currently supported |
| 165 | |
| 166 | const message = `Terminal setup cannot be run from ${terminalName}. |
| 167 | |
| 168 | This command configures a convenient Shift+Enter shortcut for multi-line prompts. |
| 169 | ${chalk.dim('Note: You can already use backslash (\\\\) + return to add newlines.')} |
| 170 | |
| 171 | To set up the shortcut (optional): |
| 172 | 1. Exit tmux/screen temporarily |
| 173 | 2. Run /terminal-setup directly in one of these terminals: |
| 174 | ${platformTerminals} • IDE: VSCode, Cursor, Windsurf, Zed |
| 175 | • Other: Alacritty |
| 176 | 3. Return to tmux/screen - settings will persist |
| 177 | |
| 178 | ${chalk.dim('Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.')}`; |
| 179 | onDone(message); |
| 180 | return null; |
| 181 | } |
| 182 | const result = await setupTerminal(context.options.theme); |
| 183 | onDone(result); |
| 184 | return null; |
| 185 | } |
| 186 | type VSCodeKeybinding = { |
| 187 | key: string; |
| 188 | command: string; |
nothing calls this directly
no test coverage detected