diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-21 09:36:53 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-21 09:36:53 +0000 |
commit | 683ddbc466bbd6ff2a890c11edccc482bfe0dc87 (patch) | |
tree | e479ab9333456cf45c6e384c4fb42bd22017a681 /tty.c | |
parent | 7825871d6a04494c704521abb6fc4240216382ca (diff) | |
download | rtmux-683ddbc466bbd6ff2a890c11edccc482bfe0dc87.tar.gz rtmux-683ddbc466bbd6ff2a890c11edccc482bfe0dc87.tar.bz2 rtmux-683ddbc466bbd6ff2a890c11edccc482bfe0dc87.zip |
Some terminals don't correctly clear their let's-wrap flag after changing the
scroll region (which moves the cursor to 0,0). This means that if the cursor
was at the edge of the screen, any further output after scroll region change
incorrectly causes a line wrap. Add a workaround to move the cursor to position
0 if it is at the screen edge before changing scroll region.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -955,6 +955,15 @@ tty_region(struct tty *tty, u_int rupper, u_int rlower) tty->rupper = rupper; tty->rlower = rlower; + /* + * Some terminals (such as PuTTY) do not correctly reset the cursor to + * 0,0 if it is beyond the last column (they do not reset their wrap + * flag so further output causes a line feed). As a workaround, do an + * explicit move to 0 first. + */ + if (tty->cx >= tty->sx) + tty_cursor(tty, 0, tty->cy); + tty->cx = 0; tty->cy = 0; |