mmiszczyk / deepmage

Hex editor for bit-level occultism
GNU General Public License v3.0
22 stars 1 forks source link

More convenient way of exiting the application #2

Closed braton closed 6 years ago

braton commented 6 years ago

Dear Author,

Please consider implementing more convenient way of exiting the application. Currently the only available option seems to be F10, however this closes my whole terminal application. I would like to be able to exit to my previous shell. How about implement the SIGNIT (Ctrl-C) to gracefully exit this process?

Thank you and Best Regards, Bartosz Zator

mmiszczyk commented 6 years ago

I'm not sure why it kills your terminal because all I'm doing is calling exit(0) when F10 is pressed. What OS and terminal emulator are you using? Does it also happen when pressing CTRL+C on a newest commit?

braton commented 6 years ago

I use GNOME Terminal 3.6.2. Anyway using Ctrl-C on latest commit works flawlessly and application exits. Thanks.

mmiszczyk commented 6 years ago

Ok, so I think this may be related to exiting when UI is active vs exiting from 'normal' commandline. Can you check if F10 is working properly now?

braton commented 6 years ago

I think the following code:

Screen.KEY_F10: lambda self: exit(0)}

is never executed as the GNOME Terminal intercepts the F10 key and handles that (automatically moving me to the File menu). I don't think there is workaround for it hence the Ctrl-C request (which works well).

mmiszczyk commented 6 years ago

Ah, ok. I've replaced exit(0) with

Screen.KEY_F10: lambda self: (_ for _ in ()).throw(KeyboardInterrupt)

but if the keypress doesn't reach my program then there's nothing I can do.