mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
fix(cli): replace hardcoded keybinding strings with dynamic formatters (#21159)
This commit is contained in:
committed by
GitHub
parent
f20e45175e
commit
1c3c7a343f
@@ -15,6 +15,7 @@ import {
|
||||
GREP_TOOL_NAME,
|
||||
MEMORY_TOOL_NAME,
|
||||
READ_FILE_TOOL_NAME,
|
||||
SHELL_PARAM_IS_BACKGROUND,
|
||||
SHELL_TOOL_NAME,
|
||||
WRITE_FILE_TOOL_NAME,
|
||||
WRITE_TODOS_TOOL_NAME,
|
||||
@@ -599,12 +600,12 @@ function toolUsageInteractive(
|
||||
interactiveShellEnabled: boolean,
|
||||
): string {
|
||||
if (interactive) {
|
||||
const ctrlF = interactiveShellEnabled
|
||||
? ' If you choose to execute an interactive command consider letting the user know they can press `ctrl + f` to focus into the shell to provide input.'
|
||||
const focusHint = interactiveShellEnabled
|
||||
? ' If you choose to execute an interactive command consider letting the user know they can press `tab` to focus into the shell to provide input.'
|
||||
: '';
|
||||
return `
|
||||
- **Background Processes:** To run a command in the background, set the \`is_background\` parameter to true. If unsure, ask the user.
|
||||
- **Interactive Commands:** Always prefer non-interactive commands (e.g., using 'run once' or 'CI' flags for test runners to avoid persistent watch modes or 'git --no-pager') unless a persistent process is specifically required; however, some commands are only interactive and expect user input during their execution (e.g. ssh, vim).${ctrlF}`;
|
||||
- **Background Processes:** To run a command in the background, set the \`${SHELL_PARAM_IS_BACKGROUND}\` parameter to true.
|
||||
- **Interactive Commands:** Always prefer non-interactive commands (e.g., using 'run once' or 'CI' flags for test runners to avoid persistent watch modes or 'git --no-pager') unless a persistent process is specifically required; however, some commands are only interactive and expect user input during their execution (e.g. ssh, vim).${focusHint}`;
|
||||
}
|
||||
return `
|
||||
- **Background Processes:** To run a command in the background, set the \`is_background\` parameter to true.
|
||||
|
||||
@@ -665,12 +665,12 @@ function toolUsageInteractive(
|
||||
interactiveShellEnabled: boolean,
|
||||
): string {
|
||||
if (interactive) {
|
||||
const ctrlF = interactiveShellEnabled
|
||||
? ' If you choose to execute an interactive command consider letting the user know they can press `ctrl + f` to focus into the shell to provide input.'
|
||||
const focusHint = interactiveShellEnabled
|
||||
? ' If you choose to execute an interactive command consider letting the user know they can press `tab` to focus into the shell to provide input.'
|
||||
: '';
|
||||
return `
|
||||
- **Background Processes:** To run a command in the background, set the \`${SHELL_PARAM_IS_BACKGROUND}\` parameter to true. If unsure, ask the user.
|
||||
- **Interactive Commands:** Always prefer non-interactive commands (e.g., using 'run once' or 'CI' flags for test runners to avoid persistent watch modes or 'git --no-pager') unless a persistent process is specifically required; however, some commands are only interactive and expect user input during their execution (e.g. ssh, vim).${ctrlF}`;
|
||||
- **Interactive Commands:** Always prefer non-interactive commands (e.g., using 'run once' or 'CI' flags for test runners to avoid persistent watch modes or 'git --no-pager') unless a persistent process is specifically required; however, some commands are only interactive and expect user input during their execution (e.g. ssh, vim).${focusHint}`;
|
||||
}
|
||||
return `
|
||||
- **Background Processes:** To run a command in the background, set the \`${SHELL_PARAM_IS_BACKGROUND}\` parameter to true.
|
||||
|
||||
Reference in New Issue
Block a user