Hello...
How to close console window automaticaly (after run command) if errorcode is 0? Ie I like to close it if all thing is ok, but leave it opened if some error ocours. I tried to use VTE but is not practical for my need.
(even closing console window at program end is better as I can wait keypres on error in my program.)
thanks Slavko.
On 20/04/14 10:22, Slavko Kocjancic wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
The way I do this is to add
&& killall whatever-terminal-program
to the end of the command. Of course, this isn’t a good idea if you have other terminals running in addition to those related to Geany...
You can search the web for 'bash &&' or something if you’re not sure why this works.
Take care,
James
On 20/04/14 11:04, James Brierley wrote:
On 20/04/14 10:22, Slavko Kocjancic wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
The way I do this is to add
&& killall whatever-terminal-program
to the end of the command. Of course, this isn’t a good idea if you have other terminals running in addition to those related to Geany...
Actually, now my brain is waking up, I remember changing it for that reason.
$COMMAND && exit
will close only 'that' terminal.
James
On 04/20/2014 12:11 PM, James Brierley wrote:
On 20/04/14 11:04, James Brierley wrote:
On 20/04/14 10:22, Slavko Kocjancic wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
The way I do this is to add
&& killall whatever-terminal-program
to the end of the command. Of course, this isn’t a good idea if you have other terminals running in addition to those related to Geany...
Actually, now my brain is waking up, I remember changing it for that reason.
$COMMAND && exit
will close only 'that' terminal.
James
In one word: "Perfect!" Thanks.
On 20 April 2014 19:22, Slavko Kocjancic eslavko@gmail.com wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
There is no automatic way of closing the terminal because there is no way of knowing if a program outputs any messages of output to stdout or stderr that the user needs to read. The return code does not provide any indication of that.
Cheers Lex
Ie I like to close it if all thing is ok, but leave it opened if some error ocours. I tried to use VTE but is not practical for my need.
(even closing console window at program end is better as I can wait keypres on error in my program.)
thanks Slavko. _______________________________________________ Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users
Am 20.04.2014 12:07, schrieb Lex Trotman:
On 20 April 2014 19:22, Slavko Kocjancic eslavko@gmail.com wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
There is no automatic way of closing the terminal because there is no way of knowing if a program outputs any messages of output to stdout or stderr that the user needs to read. The return code does not provide any indication of that.
Cheers Lex
There could be a setting for this. This is a major annoyance for a lot of people (while the other group depends on the current behavior).
Best regards.
On 20 April 2014 20:09, Thomas Martitz kugel@rockbox.org wrote:
Am 20.04.2014 12:07, schrieb Lex Trotman:
On 20 April 2014 19:22, Slavko Kocjancic eslavko@gmail.com wrote:
Hello...
How to close console window automaticaly (after run command) if errorcode is 0?
There is no automatic way of closing the terminal because there is no way of knowing if a program outputs any messages of output to stdout or stderr that the user needs to read. The return code does not provide any indication of that.
Cheers Lex
There could be a setting for this. This is a major annoyance for a lot of people (while the other group depends on the current behavior).
Agreed, though my question would be how do I know that my program is not going to output a warning message from some library (like glib).
I guess if you are running the program for the hundredth time it might be unlikely, though as Geany is an IDE the implication is that the program being run is under development and could output any old rubbish :)
Cheers Lex
Best regards.
Users mailing list Users@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/users