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

distinguish between ctrl C vs ctrl D #18

Open
timotheecour opened this issue Feb 9, 2021 · 1 comment
Open

distinguish between ctrl C vs ctrl D #18

timotheecour opened this issue Feb 9, 2021 · 1 comment

Comments

@timotheecour
Copy link

in bash, python3 and pretty much all repls, ctrl C doesn't run the current entered line but also doesn't exit the repl, whereas ctrl D (when there is no input written) exits the REPL.

here, both ctrl C and ctrl D exit the REPL. How can we at least distinguish whether ctrl C or ctrl D was entered?

example

bash-3.2$ asdf # control C was entered here
bash-3.2$ asdf # control D was entered here
bash-3.2$ exit
@jangko
Copy link
Owner

jangko commented Feb 9, 2021

use 'getKeyType to know whether the last exit condition caused by CTRL-C/CTRL-D/ESC. It's a misnomer artifact, but I keep it for historical reason.

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

No branches or pull requests

2 participants