o prompt: buffer multi-line paste input

Drains additional lines within 50ms of the first line to capture
multi-line pastes in the TUI prompt.
This commit is contained in:
Levi Neely 2026-08-07 17:44:05 +02:00
parent 8397f1aa74
commit 189ec65aae
1 changed files with 4 additions and 0 deletions

View File

@ -328,6 +328,10 @@ cmd_prompt() {
printf "\n"
break
fi
# Drain any remaining lines from a multi-line paste (bracketed paste or fast input)
while IFS= read -r -t 0.05 extra_line; do
line="$line"$'\n'"$extra_line"
done
if [[ -z "$buf" && "$line" == /* ]]; then
history -s "$line"
local cmd="${line#/}"