Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: 4855 does not work in all cases



>
> I hadn't tried this but it is the first thing which actually works
> for both xterm
> and aixterm. It doesn't work when you turn of line wrapping but I take it that
> we can get this out of terminfo/termcap (am?)? This blank,backspace thing is a
> bit of a hack so I think we should attempt to find a proper way of
> handling the
> different cases - how does ncurses or something else handle this.
>
> Looking at the man page for terminfo, I found this which might be relevant:
>
> Boolean Capabilities
>
> Variable            Cap Name  I. Code  Description
> eat_newline_glitch  xenl      xn       Ignores new-line character after 80
>                                        columns
>

Yes, ncurses looks at the eat_newline_glitch and basically does the CR-NL in
this case (look at the comments to wrap_cursor() in ncurses/do_update.c - it is
really interesting).

Unfortunately, it is not defined for dtterm (at least on our system). It seems
to be defined for xterm and one more terminal type that do have the feature. But
this is the general problem - how can you be sure that terminfo/termcap reflect
the truth? Users are free to  modify settings on the fly :-(

So, the story looks someting like

if (!am || xenl)
  puts("\r\n");

Not sure, that "\r\n" looks much better than " \n", but this works without
auto-margin as well. Funnily enough, it will work even on my dtterm (that is
configured for am but with terminfo that does not list this :-)

/andrej



Messages sorted by: Reverse Date, Date, Thread, Author