DavidGriffith / frotz

Infocom-style interactive fiction player for Unix and DOS (moved to https://gitlab.com/DavidGriffith/frotz)
GNU General Public License v2.0
209 stars 64 forks source link

Decide how Ctrl-C should be handled #37

Closed DavidGriffith closed 6 years ago

DavidGriffith commented 7 years ago

All this time, Ctrl-C caused Frotz to immediately and cleanly exit. This behavior is expected for command-line programs, but not necessarily so for full-screen programs. I have often found myself thinking in terms of a shell prompt. There, Ctrl-C will abort the line currently being typed. Perhaps that should be what Ctrl-C does in Frotz. Ctrl-Q seems like a much better choice for an immediate exit.

I'll need to fiddle around in src/curses/ux_init.c in os_init_screen() to tame raw mode. Why is it in cbreak mode?

escondida commented 6 years ago

Perhaps a better option would be to simply quit gracefully on SIGINT, which is the signal that ^C conventionally sends. That way, you don't need to care what specific keybinding they're using--the signal is what's important. Then, you could still add ^Q as an unconditional quit without getting rid of the traditional behavior.

I'm happy to work on that in the next few days if you don't feel like it (-:

DavidGriffith commented 6 years ago

I already have Frotz catching SIGINT and cleanly shutting things down things before quitting. Right now the cleanup includes turning off any audio output and turning off curses. I've decided to that I want ^C to abort the line and ^Q to quit.

I don't think I'll get to it any time soon, so I'd very much appreciate seeing what you can come up with.

escondida commented 6 years ago

I think this one's ready to be closed! One step closer to that next release!