Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to close geany terminal

Tags:

bash

ubuntu

geany

Whenever a program finishes to run when executing it with geany, the terminal doesn't close. geany terminal waits for a keystroke to close. How do I change this behavior and make it close automatically when the program reaches it's end? Is there a script I can write?

like image 763
Raz Cohen Avatar asked Nov 28 '12 11:11

Raz Cohen


2 Answers

This is not really an answer, but more like an alternative suggestion. In newer versions of Geany you can tell it to run programs in the Vitual Terminal Emulation, i.e. the terminal tab at the bottom (Settings -> Terminal -> Run Programs in VTE).

This way, the program starts more quickly (without first starting a terminal), you can still see the output generated by the program (exception stacktraces!), and the focus/cursor stays in the editor window, too.

like image 65
tobias_k Avatar answered Sep 18 '22 19:09

tobias_k


I actually found a way of doing what you want to do in the terminal instead of using Geany's VTE. The perk of that is that you can run multiple scripts at the same time (or a single one multiple times), while the VTE only executes one script at the time (at least that's the case for me).

Just go to Build -> Set Build Commands. The last type of options says "Execute commands". The standard option is python "%f". Just add && exit so that it reads python "%f" && exit.

That way the terminal window will close instantly once it's finished if the programm doesn't give you an error code. If it does, the error message will be displayed and the window is kept open.

like image 44
pohly Avatar answered Sep 18 '22 19:09

pohly