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



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