Giter VIP home page Giter VIP logo

Comments (5)

ubuntuyeah avatar ubuntuyeah commented on June 7, 2024

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"

from tilix.

egmontkob avatar egmontkob commented on June 7, 2024

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?

from tilix.

RichardJECooke avatar RichardJECooke commented on June 7, 2024

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

from tilix.

egmontkob avatar egmontkob commented on June 7, 2024

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.

from tilix.

bjd-pfq avatar bjd-pfq commented on June 7, 2024

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

from tilix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.