bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiline editing breaks if the previous output doesn't end in newli


From: Koichi Murase
Subject: Re: Multiline editing breaks if the previous output doesn't end in newline
Date: Sat, 29 Oct 2022 14:27:38 +0900

2022年10月28日(金) 21:24 Albert Vaca Cintora <albertvaka@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]