Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So there are I believe 2 questions on this already. All of them to do with tail -f and hence people give the tangent answer of "use less".

I need it for everything, every command, etc. The problem is I need to run a lot of console windows and even with multiple monitors still need to shrink them down. As a consequence just about every output is butchered by line wrapping and awkward to read.

One suggested solution is echo -ne '\e[?7l', which works, somewhat. The problem now, is there any way to get scroll bars on a console?

Ubuntu 12.10, Terminal

share|improve this question
up vote 6 down vote accepted

What you're asking is a terminal of infinite width, a portion of which is being displayed. It's not how terminals traditionally work nor how applications expect them to work.

For instance, if the terminal has infinite width, how are visual applications meant to work when they want to display something in the middle of the screen?

Something approaching that you can do though is use GNU screen (you're supposed to be able to attach a screen session from several terminals of different sizes so screen knows how to display a small window of a larger terminal) and set the screen windows width to something very large and then trick visual applications into thinking that the screen width is the original one.

Like (within screen)

c=$COLUMNS # assuming your shell has that variable
screen -X width -w 1000
stty cols "$c"

Some visual applications will work fine, some not so well (for install when they do relative positioning or when they rely on the terminal wrapping). vim seems to work OK.

Then to scroll and copy paste data, the only option is to use screen's copy mode. (<prefix>]) and move around the cursor (see info -f screen -n Movement for moving around in copy mode).

tmux may have similar capabilities.

This terminator terminal emulator (java based), which is not the terminator that comes with ubuntu also does just that with an infinite terminal width:

  • lines are never wrapped
  • visual applications are told the screen width is whatever fits in the window, not infinity.
  • it would also work better than the screen based solution above in that its terminfo entry claims it doesn't do line wrap so applications are aware of that, and BS at the start of the line doesn't move to end of the previous line.
share|improve this answer
I'm already in a gui environment so if I want to open a file in a visual editor I can just launch a gui one from the terminal. It's easier to copy in them then it is in a terminal anyway, since you can't really easily just drag select a block in a terminal with out it getting cutoff. Running screen -X width -w 1000 returns No screen session found., any ideas? – srcspider Mar 28 '13 at 13:28
@srcspider As I said, you need to do that within screen. Start screen first. – Stéphane Chazelas Mar 28 '13 at 13:46
okey I think I get you now, basically I should run screen -X width -w 1000 <mycommand> – srcspider Mar 28 '13 at 14:08
@srcspider. No. screen is a terminal based terminal emulator. So you need to start it first like you'd need to start xterm or gnome-terminal first, by running the screen command. Then, inside that new terminal emulator, you run that screen -X command to tell screen to change its window width. See also my edited answer for the terminator emulator which I suspect you'll prefer. – Stéphane Chazelas Mar 28 '13 at 14:25
Thanks! Even if somehow I don't get them to work, at least now I know why I can't get them to work like that. – srcspider Mar 28 '13 at 15:40

While Emacs is primarily an editor and IDE¹, it happens to match your problem very well. You can run a program inside an Emacs window, and Emacs displays it in a dumb terminal of infinite width and height. If the cursor is at the end of the buffer, the window will scroll as the program produces output; if you move the cursor around, the window will stay put as the output grows.

Type M-x shell RET (i.e. Alt+x shell Return) to start a shell in an Emacs buffer. Type C-u M-x shell RET or M-1 M-x shell RET to start another shell. You can run a program in each shell and arrange the buffers in multiple windows as you wish.

¹ It is sometimes said to be a better OS than editor, but only by people who don't use it — that's just a joke.

share|improve this answer

Your Answer


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.