tty: Line wrapping
Terminals that support line wrapping, aka automatic margins ("am"), are likely to support escape sequences to toggle it:
tput rmam
# Line wrapping off (long lines are truncated at the RH margin)
# ...
tput smam
# Line wrapping on (long lines are wrapped at the RH margin)
# ...
See terminfo
for more details of these escape codes.
To check whether your terminal supports automatic margins, list the capabilities with infocmp -1
.
Published on: 04 Mar 2024