refactor(cli): unify shell confirmation dialogs (#16828)

This commit is contained in:
N. Taylor Mullen
2026-01-16 15:06:52 -08:00
committed by GitHub
parent 608da23393
commit 1681ae1842
14 changed files with 102 additions and 446 deletions

View File

@@ -139,7 +139,11 @@ export const ToolConfirmationMessage: React.FC<
} else if (confirmationDetails.type === 'exec') {
const executionProps = confirmationDetails;
question = `Allow execution of: '${executionProps.rootCommand}'?`;
if (executionProps.commands && executionProps.commands.length > 1) {
question = `Allow execution of ${executionProps.commands.length} commands?`;
} else {
question = `Allow execution of: '${executionProps.rootCommand}'?`;
}
options.push({
label: 'Allow once',
value: ToolConfirmationOutcome.ProceedOnce,
@@ -276,8 +280,18 @@ export const ToolConfirmationMessage: React.FC<
maxHeight={bodyContentHeight}
maxWidth={Math.max(terminalWidth, 1)}
>
<Box>
<Text color={theme.text.link}>{executionProps.command}</Text>
<Box flexDirection="column">
{executionProps.commands && executionProps.commands.length > 1 ? (
executionProps.commands.map((cmd, idx) => (
<Text key={idx} color={theme.text.link}>
{cmd}
</Text>
))
) : (
<Box>
<Text color={theme.text.link}>{executionProps.command}</Text>
</Box>
)}
</Box>
</MaxSizedBox>
);