2022年10月28日(金) 21:24 Albert Vaca Cintora <albertv...@gmail.com>: > Description: > When there's leftover output before the prompt (ie: when the > previous command output doesn't end in a new line), editing a > multi-line command from history doesn't correctly display what you > edit. > > [...] > Option A: If the previous command doesn't end in a newline, > add a newline manually. This is what most shells do.
This can be configured by yourself. E.g., shopt -s checkwinsize { ! type -t tput || tput xenl || tput xn; } &>/dev/null; _prompt_xenl_offset=$? _prompt_newline() { (:); printf '\e[m%-*s\r\e[K' "$((COLUMNS-_prompt_xenl_offset))" '[EOF]'; } PROMPT_COMMAND+=(_prompt_newline)