Toggle line-wrapping in the terminal with 'tput rmam' and 'tput sram'

The command:

tput rmam

will disable line wrapping so that long lines are truncated to width of the terminal ($COLUMNS).

The command:

tput smam

will re-enable it.

This seems to known as "automatic margin" mode, hence smam is enter_am_mode and rmam is exit_am_mode.

Some terminals may not support this functionality.

Tagged bash and linux.

 

This page was generated at 4:16 PM on 26 Feb 2018.
Copyright © 1999 - 2018 Rodney Waldhoff.