Open RichardJECooke opened 1 year ago
Some options here: https://superuser.com/questions/600677/in-linux-console-how-to-not-wrap-output
Would be nice if it supported echo -ne "\x1b[7h"
The escape sequence \x1b[7h
was broken on the linked page (I've fixed it). The correct version is \x1b[?7h
and its counterpart \x1b[?7l
, which are supported.
However, I don't think this the behavior OP is looking for. @RichardJECooke Could you please show a concrete example? What do you exactly do in the terminal, what output do you see, and output would you rather want to see?
Sure, look at this output from docker ps
. The lines are too long and wrap around the screen. I'd rather they continue out of frame to the right and a scrollbar appears at the bottom of the window
Yup, then \x1b[?7l
is not for you. It chops off the end of the lines (and also leaves garbage in the last column).
This behavior can be achieved by helper applications such as less -S
.
Terminals, by their very nature and legacy, represent a formerly hardware device with a fixed size. There's no notion of text overflowing to the right, there's no notion of horizontal scrollbar.
An attempt to implement your desired behavior would certainly cause buggy behavior in plenty of existing apps; or if the new mode is subject to setting a mode then you'd have to manually enable it before each such command and disable afterwards. And still, it would only be supported in a few selected terminals (which agree and decide to go for it). I'm not aware of any terminal emulator out there that offers such a feature, and I find this extremely unlikely to happen. It's just that terminals have a certain behavior due to their legacy, a behavior that all the apps expect, and that behavior is unfortunately not the one you're looking for.
Or use this wrapper (I call it 'nowrap')
#!/bin/bash
# usage:
# command | nowrap
# or:
# nowrap command
# trap ctrl-c and call ctrl_c()
trap ctrlc INT
ctrlc()
{
#echo "cleaning up"
tput smam
}
# works as filter but also takes argument
if [ ! -z $1 ]
then
# called with arguments
tput rmam
$@ # run arguments
tput smam
else
# invoked as a filter
tput rmam
#</dev/stdin >/dev/stdout
cat
tput smam
fi
I'm looking for a terminal that allows me to have long lines. Can't see any way to configure this in Tilix or Gnome Terminal and was wondering if it's possible