PDA

View Full Version : Stdout limitations



damkrat
5th June 2012, 21:53
I'm writing software and using Qprocess to start external console tool

As you see on the screenshot every string in output is truncated to 80 characters.
This output is from that external tool.
What could i do to avoid this?

7804

wysota
5th June 2012, 22:31
You should ask that the author of this external tool.

damkrat
5th June 2012, 22:44
Maybe I should, but this tool works good in console and output in console is not truncated

That's weird...

wysota
6th June 2012, 00:41
That's because the application queries the terminal for its properties. And since you don't have a terminal here, the program probably assumes 80 characters per line.

ChrisW67
6th June 2012, 01:15
What type of terminal (i.e. TERM variable) do you think the console-based program is using when run through QProcess? My guess is that it is "dumb" which has a definition of 80 columns:


$ TERM=dumb tput cols
80

You need "dumb" if you do not want colour and other escape codes in the output.

There's no "dumb-wide" or equivalent I can see. You may be able to arrange calling:


stty cols 132

before running your desired console program or try setting TERM to "lpr" (line printer), "vanilla" or some other 132 column near-typewriter terminal.

damkrat
6th June 2012, 07:20
Chris, thanks a lot!!!!! Now it's clear