Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal: handle ctrl+c #53

Closed
wants to merge 1 commit into from
Closed

terminal: handle ctrl+c #53

wants to merge 1 commit into from

Conversation

tox2ik
Copy link

@tox2ik tox2ik commented Dec 11, 2020

control + C should terminate a text-stream handler like this.
Check out how cat, awk, sed and every other program in this category behaves.
Thanks.

@maruel
Copy link
Owner

maruel commented Dec 11, 2020

The current behavior is very much intentional, see https://github.com/maruel/panicparse/#investigate-deadlock

@maruel maruel closed this Dec 11, 2020
@tox2ik
Copy link
Author

tox2ik commented Dec 12, 2020

crtl+c is not ctrl+\. I understand you may have reasons for ignoring ctrl+\, but your program is not behaving as a terminal program should by ignoring ctrl+c. I see that ctrl+d works as usual, which is something, at least. Not a big deal, but you are "wrong" about dismissing my pull request. Who cares about conventions, anyway, right?

Also, the installation instructions; go get github.com/maruel/panicparse/v2/cmd/pp , simply does not work;

$ go get github.com/maruel/panicparse/v2/cmd/pp
package github.com/maruel/panicparse/v2/cmd/pp: cannot find package "github.com/maruel/panicparse/v2/cmd/pp" in any of:
	/usr/lib/go/src/github.com/maruel/panicparse/v2/cmd/pp (from $GOROOT)
	/home/jaroslav/src/go/src/github.com/maruel/panicparse/v2/cmd/pp (from $GOPATH)

@maruel
Copy link
Owner

maruel commented Dec 12, 2020

Part of the rationale is Windows. There's no SIGQUIT there.

Part of the rationale is that Ctrl-C will be caught by the first app in the pipe (generally go test) and will close nicely. If panicparse exits because stdin closes, it may cause problems. If panicparse was to close before the piped in tool would terminate, it would mess the pipeline.

I understand that normal tooling like cat, awk and sed just quit on SIGINT but panicparse intentionally wants to catch surprising failures.

About go get, I get:

$ go get github.com/maruel/panicparse/v2/cmd/pp
go: found github.com/maruel/panicparse/v2/cmd/pp in github.com/maruel/panicparse/v2 v2.0.1

There's some idiosyncracy with go module versioning I think the fix is try_real_v2 but I haven't had the time to confirm yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants