On 2018/10/30 10:17, Nicholas Marriott wrote:
> I think we should probably just do this. I don't see any modes that
> shouldn't be reset by RIS.
> 
> server_client_reset_state is different, it is used to set the state of
> the external client tty when tmux is idle (after it has finished any
> drawing it needs to do).
> 
> Index: screen-write.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/tmux/screen-write.c,v
> retrieving revision 1.140
> diff -u -p -r1.140 screen-write.c
> --- screen-write.c    25 Oct 2018 15:13:38 -0000      1.140
> +++ screen-write.c    30 Oct 2018 10:13:47 -0000
> @@ -144,8 +144,7 @@ screen_write_reset(struct screen_write_c
>       screen_reset_tabs(s);
>       screen_write_scrollregion(ctx, 0, screen_size_y(s) - 1);
>  
> -     s->mode &= ~(MODE_INSERT|MODE_KCURSOR|MODE_KKEYPAD|MODE_FOCUSON);
> -     s->mode &= ~(ALL_MOUSE_MODES|MODE_MOUSE_UTF8|MODE_MOUSE_SGR);
> +     s->mode = MODE_CURSOR | MODE_WRAP;
>  
>       screen_write_clearscreen(ctx, 8);
>       screen_write_cursormove(ctx, 0, 0);

This works just as well in my case. Thanks.

> 
> On Tue, Oct 30, 2018 at 02:35:34PM +0900, Benjamin Poirier wrote:
> > 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.

-- 
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