On Sun, 04 Aug 2013, Beno?t Minisini wrote: > Le 04/08/2013 17:59, Tobias Boege a ?crit : > > Hi Benoit, > > > > when writing programs that use gb.ncurses it is difficult to emit debugging > > information, i.e. one cannot use the handy Debug or Error instructions > > because they write "string\n" to stderr where "string\r\n" would be needed > > in ncurses mode. > > > > While it would be easy to add a "\r" to the end of each string, it would > > also most likely mess up the display of the program. I think it would be > > best to be able to redirect the standard error of a program which is run in > > a terminal emulator back to the console window in the IDE. > > > > In my imagination this would be a simple checkbox in the project options > > dialog. Could you please implement this? > > > > Regards, > > Tobi > > > > Why does ncurses change the behaviour of the standard error stream? I > don't see the reason... >
It changes the tty line discipline and stderr just happens to be directed to that tty. Normally the tty has the ONLCR bit set when humans operate with it which means: translate each incoming newline into a carriage-return- newline sequence. NCurses turns this bit off. Try "stty -onlcr" in a terminal to see the result. > And what do you mean by "redirect the standard error of a program which > is run in a terminal emulator back to the console window in the IDE"? > This is what is already done for all debugged programs! > AFAICS, when I have the "Use a terminal emulator" setting checked in the project options, writing to stderr results in output to the controlling terminal (xterm in my case), not to the IDE console. I have a screenshot attached and the project used to generate the display. I hope this makes it clear enough? I'd like to have an option to send the strings from Error and Debug to the IDE console, not to the terminal emulator. Regards, Tobi
no-carriage-return-0.0.1.tar.gz
Description: Binary data
<<attachment: no-carriage-return.png>>
------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user