-
Hey 👋 Just want to clarify how Even outside of GoNix itself I observe the following behaviour: (⎈ |local:default)
prologic@Jamess-iMac
Thu Sep 15 13:57:08
~/tmp/sh
(master) 0
$ ./gosh
$ ^C
(⎈ |local:default)
prologic@Jamess-iMac
Thu Sep 15 13:57:11
~/tmp/sh
(master) 130
$ echo $?
130
In say a Bash shell, Some context, to this question. I'm actually trying to debug some missing or bad signal handling where-by hitting Thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
I assume this is a question for cmd/gosh, the main program that implements a fairly basic interactive shell? There's a fairly easy answer here: we don't set up any signal handlers, so ^C has its default behavior, which is to kill the entire process :) We should probably teach gosh to do the right thing instead, which seems to be to discard the in-progress line and start a new line. |
Beta Was this translation helpful? Give feedback.
-
@mvdan Would you accept a patch like the one here: https://git.mills.io/prologic/gonix/commit/d8755bba8d09259551280134399faa40ad8e7e9a if so I'll submit a PR as I've basically just borrowed most of your |
Beta Was this translation helpful? Give feedback.
I assume this is a question for cmd/gosh, the main program that implements a fairly basic interactive shell?
There's a fairly easy answer here: we don't set up any signal handlers, so ^C has its default behavior, which is to kill the entire process :) We should probably teach gosh to do the right thing instead, which seems to be to discard the in-progress line and start a new line.