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

Readline catches SIGINT #9

Open
amagura opened this issue Oct 27, 2017 · 1 comment
Open

Readline catches SIGINT #9

amagura opened this issue Oct 27, 2017 · 1 comment
Assignees

Comments

@amagura
Copy link
Owner

amagura commented Oct 27, 2017

Issue Description(s)

CSI responds to SIGINT differently after readline is loaded

When csi is started without an rc file (e.g. csi -n) it: responds to SIGINT immediately and prints a new prompt, however, when/after readline has been loaded, csi only responds to SIGINT after encountering a carriage return (\r): this behavior is awkward and differs from other major lisps implementations such as clisp and sbcl (both of which respond to SIGINT after a short pause without any further intervention from the user).

CSI reports an unknown variable named rl_catch_signals when loading readline.so

; loading /home/rr257875/usr/lib/chicken/8/readline.so ...
readline: rl_catch_signals: unknown variable name

After doing a small amount of research, I realized that the issue is caused by the following code in interface.c:

#endif
     rl_completion_entry_function = &gnu_readline_tab_complete;
     rl_variable_bind("rl_catch_signals", 0);
     rl_clear_signals();
     rl_set_signals();

In the code above, rl_variable_bind is being misused, it is not designed to set C variables, but readline variables such as you could set by calling set ... on the command-line.

The code should be something like this:

#endif
     rl_completion_entry_function = &gnu_readline_tab_complete;
     int rl_catch_signals = 0;
     rl_clear_signals();
     rl_set_signals();

This misuse does not seem to be present in trunk, but is present in the most recent release.

@amagura amagura added the bug label Oct 27, 2017
@amagura amagura added this to the readline-v4.2.0 milestone Oct 27, 2017
@amagura amagura self-assigned this Oct 27, 2017
@amagura amagura mentioned this issue Oct 27, 2017
4 tasks
@amagura
Copy link
Owner Author

amagura commented Oct 27, 2017

#8 would have resolved the issue with rl_catch_signals creating that warning in csi; however, I forgot to promote those changes into the wild.

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

1 participant