Skip to content

Conversation

ChinYikMing
Copy link
Collaborator

@ChinYikMing ChinYikMing commented Dec 10, 2024

How to reproduce?

  1. Run the emulation.
$ make check
  1. Terminate the emulation via keyboard CTRL + a + x.

  2. Run some shell interactive program (e.g., cat).

$ cat
  1. Try to terminate the shell interactive program (e.g., cat) via keyboard CTRL + c.
    The SIGINT cannot be caught and propagate to the cat process. Example output:
$ cat
apple
apple
^C^C^C^C^C

This patch fix this issue.

@ChinYikMing ChinYikMing force-pushed the fix/termios-control-mode branch from 8439418 to c3b6383 Compare December 10, 2024 06:39
The ISIG control mode is disabled in capture_keyboard_input(), but
it is not reset in reset_keyboard_input(). This inconsistency causes
default keyboard signal malfunctions (e.g., SIGINT from CTRL+C) after
exit. To fix this, the termios control flag is encapsulated in a
macro, TERMIOS_C_CFLAG and used in both capture_keyboard_input() and
reset_keyboard_input().
@ChinYikMing ChinYikMing force-pushed the fix/termios-control-mode branch from c3b6383 to 58598a8 Compare December 10, 2024 06:41
@jserv jserv merged commit 59d39f5 into sysprog21:master Dec 10, 2024
3 checks passed
@jserv
Copy link
Collaborator

jserv commented Dec 10, 2024

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the fix/termios-control-mode branch December 10, 2024 07:02
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 this pull request may close these issues.

2 participants