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:
parent
e375126adf
commit
19a96ab2de
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue