Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug report] prompt can erase messages written on the terminal by background processes
- X-seq: zsh-workers 51129
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Millian Poquet <millian.poquet@xxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [bug report] prompt can erase messages written on the terminal by background processes
- Date: Wed, 7 Dec 2022 19:46:37 -0800
- Archived-at: <https://zsh.org/workers/51129>
- In-reply-to: <CAN=4vMq2kc1cSV_0N-c6o32C3UR3hVSjE3mF+kV4pjcy7YR9=g@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <9e3026aa-39a1-dd50-4d29-a64724d4eaaf@irit.fr> <CAN=4vMq2kc1cSV_0N-c6o32C3UR3hVSjE3mF+kV4pjcy7YR9=g@mail.gmail.com>
On Wed, Dec 7, 2022 at 2:57 PM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Wed, Dec 7, 2022 at 8:04 PM Millian Poquet <millian.poquet@xxxxxxx> wrote:
> >
> > prompt can erase messages written on the terminal by background processes
>
> There is no way around it. Zle assumes that nobody else prints to the terminal.
Perhaps try this.
get_cursor_pos() {
print -n $'\e[6n'
IFS=$'\e[;' read -s -d R -A ${1:-reply}
shift 3 ${1:-reply}
}
precmd() {
local rowcol
get_cursor_pos rowcol
if (( $rowcol[1] > 1 ))
then print
fi
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author