mirror of
https://github.com/sheumann/hush.git
synced 2025-01-10 16:29:44 +00:00
Fix problem where the system crashed as soon as you typed anything at the hush prompt in TMTerm or GSI.
The problem seemed to be that it crashes if the t_intrc special character is set to -1 on a pty. I worked around this by setting it to an obscure control character instead in that case.
This commit is contained in:
parent
dc3caf92e7
commit
c37319db8a
@ -2492,8 +2492,14 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
|
||||
ioctl(STDIN_FILENO, TIOCSETN, &new_settings);
|
||||
/* Contrary to documentation, tchars aren't fully disabled in CBREAK mode,
|
||||
* so do it explicitly. Maybe other characters should be disabled too? */
|
||||
/* Hack: GNO crashes if given -1 for t_intrc on a pty. Specify a
|
||||
* rarely-used control character instead in that case. */
|
||||
new_tchars = initial_tchars;
|
||||
if (ttyname(STDIN_FILENO) && strncmp(ttyname(STDIN_FILENO), ".ttyq", 5) != 0) {
|
||||
new_tchars.t_intrc = (char)-1;
|
||||
} else {
|
||||
new_tchars.t_intrc = (char)30;
|
||||
}
|
||||
ioctl(STDIN_FILENO, TIOCSETC, &new_tchars);
|
||||
new_ttyk = initial_ttyk | VT100ARROW | OAMAP | OA2META;
|
||||
ioctl(STDIN_FILENO, TIOCSETK, &new_ttyk);
|
||||
|
Loading…
x
Reference in New Issue
Block a user