o prompt: fix readline line editing with ANSI prompt

Wrap bold escape sequences in \001/\002 markers so readline
correctly tracks cursor position. Fixes Ctrl+U, Ctrl+W, and
other readline kill commands after typing several characters.
This commit is contained in:
Ollie Agent 2026-08-04 18:56:19 +02:00
parent e375126adf
commit 19a96ab2de
1 changed files with 1 additions and 1 deletions

View File

@ -260,7 +260,7 @@ cmd_prompt() {
while true; do
local prompt_str
if [[ -z "$buf" ]]; then
prompt_str=$'\033[1m>\033[0m '
prompt_str=$'\001\033[1m\002>\001\033[0m\002 '
else
prompt_str=" "
fi