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.
ls
andmcedit
work fine in it, because screen width and buffer width are handled separately. – c z Mar 18 '20 at 14:57echo -ne '\e[?7l'
actually does. I can see that it makes lines no longer wrap to the next line when you keep sending input, but... this just eats up the characters (sometimes for me it wraps around and other times it stays put on the last column). By scrollbar you are asking about how to navigate to view the rest of the content right? I thinkecho -ne '\e[?7l'
will just have the terminal "eat" that content, it seems like it's lost. The purpose of this comment is just to point out thatecho -ne '\e[?7l'
isn't much of a solution because of this issue. – Steven Lu Apr 19 '21 at 19:51
– Steven Lu Apr 19 '21 at 20:04P s = 7 → No Wraparound Mode (DECAWM)