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

rustyline overwrites previously registered SIGWINCH handler #606

Closed
PaulJuliusMartinez opened this issue Mar 3, 2022 · 2 comments · Fixed by #608
Closed

rustyline overwrites previously registered SIGWINCH handler #606

PaulJuliusMartinez opened this issue Mar 3, 2022 · 2 comments · Fixed by #608

Comments

@PaulJuliusMartinez
Copy link

If an application registers a SIGWINCH handler prior to initializing rustyline, rustyline will override it when it installs its own SIGWINCH handler. Installation of the SIGWINCH handler takes place here.

The sigaction system call can return the function pointer for the previously registered signal handler. rustyline could store this value and call the function if it is non-NULL. (See this StackOverflow question.) The alternative for the application is to register their signal handler after initializing rustyline and either save the reference to rustyline's signal handler, or leave rustyline's signal handler abandoned, but people probably don't expect rustyline to install a SIGWINCH handler, so they'll only realize this once it causes a bug.

@gwenn
Copy link
Collaborator

gwenn commented Mar 3, 2022

Should we use signal-hook ?

@gwenn
Copy link
Collaborator

gwenn commented Jul 17, 2022

Version 10.0.0 released.

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 a pull request may close this issue.

2 participants