I have written a Ruby script to manage my LyX documents. The script has a short CLI interaction with the user(=me), and then it decides the name of the file to open, and opens it via a
lyx shell command.
Now, the problem is, I need a terminal for the CLI interaction, but when I close the terminal, LyX pops a message box that says "SIGHUP signal caught! Bye." and when I click on
OK, it closes LyX.
That problem occurred when I launched the shell via Ruby's
exec command(that closes the ruby process and starts a new process for the given shell command). When I tried to replace it with a fork, the LyX windows never opened - my guess was that LyX received the
SIGHUP when the Ruby script finished and the terminal closed - and I confirmed that guess when I added a
gets command at the end of the Ruby script to prevent it from closing - and then the LyX window was opened, but when I pressed
Enter to finish the ruby script, LyX received the
SIGHUP and closed.
Now, I can probably solve this by replacing the CLI interaction with a GUI and giving up on the terminal window, but using a GUI for something like that seems like an overkill to me. So, is there a way to prevent LyX from closing when I close the terminal?
I'm running OpenSUSE 12.1 64bit with KDE, and the terminal emulator is Konsole.