Commit a6c4c2cca0d4 ("Implement DECAWM (SM/RM 7) using existing MODE_WRAP
flag.") added support for the DECAWM sequence to turn autowrap on and off.
However, `reset` does not reset this mode to its default value (on). This
leads to some garbled output with long lines.

---
I tested xterm, urxvt and screen; all of them reset the autowrap mode so
that seems like an omission in tmux.

The simplest approach to fix the issue is to reset the mode in
screen_write_reset() like most other options changed via DEC private
mode sequences. However, MODE_CURSOR (cursor visibility) is reset via
server_client_reset_state() instead, so that seems like another
possibility. I didn't find a reason that would justify the extra
complexity though.

---
 screen-write.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/screen-write.c b/screen-write.c
index e583c72d..dd722666 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -146,6 +146,7 @@ screen_write_reset(struct screen_write_ctx *ctx)
 
        s->mode &= ~(MODE_INSERT|MODE_KCURSOR|MODE_KKEYPAD|MODE_FOCUSON);
        s->mode &= ~(ALL_MOUSE_MODES|MODE_MOUSE_UTF8|MODE_MOUSE_SGR);
+       s->mode |= MODE_WRAP;
 
        screen_write_clearscreen(ctx, 8);
        screen_write_cursormove(ctx, 0, 0);
-- 
2.19.0

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to