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

SIGINT hardcoded to Ctrl+C? #3328

Closed
atsepkov opened this issue Oct 12, 2015 · 7 comments
Closed

SIGINT hardcoded to Ctrl+C? #3328

atsepkov opened this issue Oct 12, 2015 · 7 comments
Labels
feature request Issues that request new features to be added to Node.js. readline Issues and PRs related to the built-in readline module.

Comments

@atsepkov
Copy link

I've had to remap my SIGINT to a different key via stty:

stty intr \^K

Now ^K performs interrupts correctly in all GNU apps I tried. node, however, ignores ^K sequence, it still responds to ^C, which no longer should send SIGINT.

@bnoordhuis
Copy link
Member

Node.js puts the tty into raw mode (think stty raw -echo) so it doesn't surprise me that it doesn't work.

@bnoordhuis bnoordhuis added the console Issues and PRs related to the console subsystem. label Oct 12, 2015
@atsepkov
Copy link
Author

FYI, this logic seems to be at https://github.com/nodejs/node/blob/master/lib/readline.js#L688. All of these are hardcoded. Could those either be read from stty -a or a config file?

@Fishrock123
Copy link
Contributor

@atsepkov That only counts if you have readline (i.e. the REPL) open.

I'm not sure where the logic is, but @bnoordhuis answer is likely correct for interrupting non-readline programs.

I don't see much point in changing one if we don't change both.

Edit: actually I don't think changing the readline one is really possible since it doesn't pick up your terminal's config.

@bnoordhuis
Copy link
Member

It wasn't very clear the original post was about the REPL.

Yes, the REPL has ^C hard-coded. No, I don't think it's very worthwhile to detect alternative mappings. Lots of complexity for an infinitesimally small fraction of the user base.

@Fishrock123 Fishrock123 added the feature request Issues that request new features to be added to Node.js. label Oct 13, 2015
@atsepkov
Copy link
Author

Could I at least have the option to configure them without editing the source? This is a bug (it's a hardcoded setting that happens to hold 95+% of the time), even if the affected user base is small. Also, calling it infinitesimally small is falling victim to availability bias. Google "ctrl+c remapping terminal", "stty remapping", etc. and you'll see plenty of examples of users talking about it.

@Fishrock123 Fishrock123 added readline Issues and PRs related to the built-in readline module. and removed console Issues and PRs related to the console subsystem. labels Jan 22, 2016
@Fishrock123
Copy link
Contributor

Moving to #4758 since the new issue is more clear.

@Fishrock123 Fishrock123 added duplicate Issues and PRs that are duplicates of other issues or PRs. and removed duplicate Issues and PRs that are duplicates of other issues or PRs. labels Jan 22, 2016
@Fishrock123
Copy link
Contributor

bah this issue is about hard-coding, sorry, that's something else.

I'm going to close since there isn't action though. Configuring your terminal will not necessarily configure programs you run! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

No branches or pull requests

3 participants