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

Interrupt on SIGINT #417

Open
3 tasks
magicant opened this issue Sep 26, 2024 · 0 comments
Open
3 tasks

Interrupt on SIGINT #417

magicant opened this issue Sep 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@magicant
Copy link
Owner

magicant commented Sep 26, 2024

Although POSIX says the shell should perform "no action" on catching SIGINT, most existing shell implementations interrupt the currently running command line on SIGINT, allowing the user to quit from blocking built-ins such as wait and read. It would be desirable to implement this behavior in yash-rs, too.

The implementation boils down to the following steps:

  • Interrupt if a foreground job is terminated by SIGINT
  • Interrupt if the shell itself catches SIGINT

Questions:

  • The SharedSystem::read_async and SharedSystem::write_all functions enable the file descriptor's blocking mode temporarily. If the execution of these functions is terminated abruptly, the file descriptor may be left without being restored to the previous blocking mode configuration. How do we avoid this?
@magicant magicant added the enhancement New feature or request label Sep 26, 2024
@magicant magicant added this to yash-rs Sep 26, 2024
@magicant magicant added this to the 0.1.0 β3 milestone Sep 26, 2024
@github-project-automation github-project-automation bot moved this to To do in yash-rs Sep 26, 2024
@magicant magicant mentioned this issue Sep 26, 2024
27 tasks
@magicant magicant removed this from the 0.1.0 final milestone Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

1 participant