(Go: >> BACK << -|- >> HOME <<)

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

Ctrl+c does not abort during server-side stream #506

Open
bartslinger opened this issue Feb 19, 2022 · 5 comments
Open

Ctrl+c does not abort during server-side stream #506

bartslinger opened this issue Feb 19, 2022 · 5 comments

Comments

@bartslinger
Copy link

Describe the bug

When I call a (long-lived) server-side stream, I cannot cancel or stop the program by pressing ctrl+c. This used to work until version 0.10.0, but is broken since 0.10.1.

To reproduce

Call a server-side stream and press ctrl+c

Expected behavior

The program shuts down

Environment

  • OS: ubuntu 21.10
  • Terminal: bash/zsh/sh
  • Evans version: 10.1/10.2
  • protoc version: 3.12.4
@ktr0731
Copy link
Owner
ktr0731 commented Mar 12, 2022

This is maybe caused by c-bata/go-prompt, a dependent library. However, we still need to dig down to find the root cause.

@bombsimon
Copy link

I'm not sure if this is related but I noticed that in my shell, if I launch the evans REPL and exit it (with ^d) ^c stops working in my terminal until I call reset.

This is all that's needed for a repro

# This should work
% # hello, pressing ctrl+c

# Now launch evans with any proto and exit (`^d`)
% evans some.proto
[...]
127.0.0.1:50051>
Good Bye :)

# Now try the first line again, `^c` is not working:
% # hello, pressing ctrl+c

macOS 12.2 (arm), zsh 5.8, evans 0.10.4

@bombsimon
Copy link

The issue with ^c not working after using the repl is fixed for me since 0.10.6. I have not tested the original problem though. Since my previous comment I've also updated oh-my-zsh and installed a newer version of bash in PATH so this might very well have been the solution as well. Anyhow, just wanted to add that my issue does no longer exist.

@ktr0731
Copy link
Owner
ktr0731 commented Apr 29, 2022

@bombsimon
Thanks for the report!
The issue that you reported is related to the version of c-bata/go-prompt. The library is updated to a newer one in #528, so this problem is fixed.

FYI: the original issue is not related to this problem.

@HeinKalido
Copy link

The current version (0.10.9) exits on ctrl+c. This causes the user have to re-run the repl.
An alternative would be to cancel the context on the signal, which is a similar behaviour for bidi streams.

If you agree that this would be a useful change, I can make PR.

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

No branches or pull requests

4 participants