#14 No wrap: truncate output (don't line wrap)

open
nobody
2014-02-26
2012-07-27
Anonymous
No

This request is to duplicate GNU Screen's "wrap" setting. By default (wrap on) tmux would wrap lines that exceed the width of the current display (stty -a | grep columns). With wrap off, tmux truncates the output so line wrapping does not occur.

This is very useful when tailing long (wide) log files and following compile sessions.

Discussion

  • What's wrong with piping through cut -c-$COLUMNS?

     
  • Doug Poland
    Doug Poland
    2012-08-14

    Piping through cut only works if you think of that *before* you issue a command or tail a file. If I think of it, I currently pipe through less with -S switch. The less trick works if you re-size your term/window/pane, not sure if cut exhibits that behavior.

    Also, your $COLUMNS is, I believe, a bashism. I use tmux on Solaris, FreeBSD, Mac OS X, Linux with ksh, tcsh, and bash. In my world, having tmux understand line wrap would increase portability and reduce complexity across environments.

     
  • COLUMNS is from ksh I suspect rather than bash but there are other ways to get it anyway, that's not the point.

    I'll add it to the todo list anyway, there is a DEC escape sequence to suppress line wrapping and if someone implements that it would be fairly easy to add an option at the same time.

     
  • Ticket moved from /p/tmux/feature-requests/94/