You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I was silly and ran the following program:
package main
import (
"github.com/nsf/termbox-go"
)
func main() {
termbox.Init()
defer termbox.Close()
for {
e := termbox.PollEvent()
termbox.SetCell(0, 0, e.Ch, termbox.ColorDefault, termbox.ColorDefault)
termbox.Flush()
}
}
While it does the intended thing of displaying the last key press, I accidentally wrote an infinite loop. Normally, I would just press ctrl-c to send a SIGINT, and the program would use the default signal handler and just quietly terminate. However, with termbox, instead the ctrl-c is not seen as a SIGINT. Instead, the ctrl-c will show up as an event from PollEvent. Obviously I'm being cheeky with this example, but in general, is there a way to tell termbox to respect the default signal handlers for things like SIGINT from ctrl-c or SIGTSTP from ctrl-z?
The text was updated successfully, but these errors were encountered:
It doesn't ignore SIGINT, it disables binding of Ctrl-C to SIGINT. You can still kill the app with a "kill" command or any other way you can send a SIGINT signal to it. I'm afraid it's impossible to get Ctrl-C binding back as termbox uses raw terminal input mode.
Applications like emacs could use this feature, I mean C-c is an ordinary key combo in emacs. So even if it's possible to enable C-c sending SIGINT alone, I wouldn't do it.
Suppose I was silly and ran the following program:
While it does the intended thing of displaying the last key press, I accidentally wrote an infinite loop. Normally, I would just press ctrl-c to send a SIGINT, and the program would use the default signal handler and just quietly terminate. However, with termbox, instead the ctrl-c is not seen as a SIGINT. Instead, the ctrl-c will show up as an event from PollEvent. Obviously I'm being cheeky with this example, but in general, is there a way to tell termbox to respect the default signal handlers for things like SIGINT from ctrl-c or SIGTSTP from ctrl-z?
The text was updated successfully, but these errors were encountered: