feat: multi-line text answers in ask-user tool (#18741)

This commit is contained in:
Jack Wotherspoon
2026-02-11 09:14:53 -05:00
committed by GitHub
parent 63e9d5d15f
commit 5baad108d9
8 changed files with 122 additions and 43 deletions

View File

@@ -13,6 +13,7 @@ import chalk from 'chalk';
import { theme } from '../../semantic-colors.js';
import type { TextBuffer } from './text-buffer.js';
import { cpSlice, cpIndexToOffset } from '../../utils/textUtils.js';
import { keyMatchers, Command } from '../../keyMatchers.js';
export interface TextInputProps {
buffer: TextBuffer;
@@ -45,7 +46,7 @@ export function TextInput({
return true;
}
if (key.name === 'return' && onSubmit) {
if (keyMatchers[Command.SUBMIT](key) && onSubmit) {
onSubmit(text);
return true;
}