Diggy
Diggy

Reputation: 230

How to stop console to prompt the user during output, under gdb and octave?

I am using Kubuntu and its Konsole terminal. I have annoying behavior using different applications from console such as gdb or octave. The problem is following: the program outputs one screen of text and than stops, prompting me with double colon and waiting for me to press any key so that it can continue with the output. So if the output is big (for example 10000 iterations in octave which print some values) I have to click Enter numerous times until I get to the end of the output. I would like not to be prompt at all. I don't know if this is due to bash, Konsole application or a program in question (gdb or octave for example).

Upvotes: 1

Views: 1011

Answers (5)

scottt
scottt

Reputation: 7228

For GDB, you can use "set pagination off" to change this behavior. See GDB Manual: Screen Size. I tend to toggle pagination on and off quite often as I use GDB.

Upvotes: 1

carandraug
carandraug

Reputation: 13081

For the specific case of GNU Octave, you can turn off this behavior by running more off at the Octave prompt. You may want to add that line to your .octaverc file.

Upvotes: 2

jordanm
jordanm

Reputation: 34924

Similar to Jantio's answer, you can use can use cat as your pager by setting the PAGER environment variable:

For all commands:

export PAGER=cat

For a single command:

PAGER=cat git log

Upvotes: 1

I think the output is being presented through a pager (ie. probably less or more).

One simple way to bypass this is to redirect the output using cat:

my_command | cat

Hope this helps =)

Upvotes: 0

Gilles Quénot
Gilles Quénot

Reputation: 185005

If you need to repeat an input automatically, then yes is your solution :

$ yes | any_app_waiting_input

As default behaviour, yes print a "y". You can put an argument to yes if you want anything else, like newlines : yes ""

Upvotes: 1

Related Questions