I use TMOUT=10 - 10s to update time in prompt so it caused scroll always go back to current prompt. For i.e: If I scroll back serverl pages of output then 10s later, zsh scroll down when prompt was reset.

How to avoid this issue?

  • The scroll back upon application output is something you'd have to tell your terminal emulator not to do. For instance, with xterm, see the -si option (also in rxvt) and scrollTtyOutput X11 resource – Stéphane Chazelas Aug 28 '18 at 12:19
  • Not true, zsh reset-prompt draw focus on current prompt, it doesn't cause clear screen but does something in background. – Tuyen Pham Aug 28 '18 at 12:41
  • The point is that without -si, xterm cancels the scroll when some data is coming from applications running in the terminal. reset-prompt rewrites the prompt so sends some data. zsh has no visibility and no possible control whatsoever on terminal scrolling, there's nothing it can do. – Stéphane Chazelas Aug 28 '18 at 12:45
  • If that I use system32/bash.exe on windows10. I don't have xterm, don't see any kind of such options in window's properties. – Tuyen Pham Aug 28 '18 at 12:48
  • If that behaviour of the Windows terminal emulator (note that bash is not a terminal emulator, it's a shell, I suppose Windows invokes a terminal emulator by itself when you start bash) cannot be disabled, there's little you can do. You could run a terminal-emulator within the terminal emulator like screen or tmux that don't do that and use their scrolling capabilities. I'd expect you'd be able to use xterm or other Unix terminal emulator on Windows. – Stéphane Chazelas Aug 28 '18 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.