haskell / haskell/process

Delegate Control-Z handling (SIGTSTP)

Open
#68 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
91
Forks
91
PR merge metrics
No merged PRs in 30d

Description

The [Control-C handling on Unix](https://hackage.haskell.org/package/process-1.4.2.0/docs/System-Process.html#g:4) documentation describes a `delegate_ctlc` option that allows the child process to control what happens when Control-C is pressed. I'm wondering if a similar option should be provided to allow the child process to control what happens when Control-Z is pressed.

Without such an option, the child process can install a SIGTSTP handler to customize Control-Z behavior, but the parent process suspends unconditionally, immediately returning control to the shell. This would be undesirable for applications that need to react differently to Control-Z (e.g. by suspending an internal computation instead of suspending the whole program).

A `delegate_ctlz` option would cause the parent process to ignore SIGTSTP while waiting for the child process to _either terminate or suspend_ (using the WUNTRACED option). If the child suspends, then the parent should suspend itself in turn.

FWIW, the [“Proper handling of SIGINT/SIGQUIT”](http://www.cons.org/cracauer/sigint.html) article doesn’t mention anything about SIGTSTP.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the existing delegate_ctlc documentation and compare its Unix signal behavior with the proposed delegate_ctlz option. Investigate how the parent waits for termination or suspension with WUNTRACED; done means the child can handle SIGTSTP and the parent suspends itself only when the child suspends.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.