19

I'm a long time screen user trying to make the jump to tmux. One screen feature I use is the ability to truncate Ctrla :set wrap output. This is especially useful when tailing log files or following compile sessions whose lines are hundreds of characters long.

I've read the man page and googled extensively and cannot find an equivalent command, or a viable work-around using shell commands. The closest I can come up with is piping everything to less -S and putting less into "follow" mode.

jasonwryan
  • 73,126
Doug
  • 191

2 Answers2

13

I have tmux 2.6, and I can run the command setterm -linewrap off to have long lines truncated instead of wrapped.

See these answers:

ddffnn
  • 191
  • However, this command has nothing to do with tmux. In particular, if you expand a tmux pane to the right, the truncated characters are still gone. – Torsten Bronger Dec 17 '20 at 20:43
9

I don't think tmux has this feature, feature request?

One pipable workaround that I often use is "cutting" up to and including $COLUMNS:

tail -f LOG | cut -c1-$COLUMNS

Note that this is not "nowrap", it actually removes the ends of the lines. Also, terminal resizing is not acted upon.

Thor
  • 17,182
  • Thanks for the info. I've tried variations on the theme as well. I've found "less -eS --follow-name" to be as close as I can get... IF if remember to run that command first. – Doug Jul 27 '12 at 16:14
  • 1
    You might do a little better with less +G +F -eS --follow-name, that will get you directly into tail mode. But you're right, it would be better if the terminal handled the wrapping. – Thor Jul 27 '12 at 16:23
  • +G is actually redundant. – Thor Jul 27 '12 at 16:53
  • This unfortunately doesn't work with xtail... – MemphiZ Dec 24 '16 at 00:37