gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.36k stars 293 forks source link

Can you turn off word wrap? #2173

Open RichardJECooke opened 1 year ago

RichardJECooke commented 1 year ago

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

ubuntuyeah commented 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"

egmontkob commented 10 months ago

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?

RichardJECooke commented 10 months ago

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

image

egmontkob commented 10 months ago

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.

bjd-pfq commented 6 months ago

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