Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to tell the terminal not to wrap long lines. I wish to see a line in the same space without wrapping to the next one. I do not care if I can not see the end of the line just as long as the line stays in one. A horizontal scroll would be good for this also but for the moment the removal of the wrapping is what I need.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

It depends on what application you are using.

If you are viewing a file or command output using less, passing the -S option (a.k.a. --chop-long-lines) will cause output to be chopped off rather than wrapping to a new line. You can use the horizontal arrow keys to view the rest of the line.

For generic non full screen applications, you can turn off line wrapping by sending an appropriate escape sequence to the terminal:

tput rmam

This mode can be cancelled with a similar escape:

tput smam

Details on adjusting the behaviour for a few other command line tools can be found here:

http://tomayko.com/writings/StupidShellTricks

share|improve this answer
    
Nice link although I did not expect something like that to change the behavior. +1. –  Luis Alvarado Oct 29 '11 at 15:59
    
Very interesting. I tried this with gnome terminal, and it sorta-kinda works, but it is also causing output to be chopped off. What I'd prefer is for the terminal to 'pretend' it had infinite line width, so it would just keep writing the line and then I could retrospectively go see the rest of the line by resizing or scrolling in the terminal window somehow. Is this possible? –  wim Feb 12 '13 at 2:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.