Skip to content

Signal handling (SIGINT, SIGTSTP, SIGCHLD) #44

@cdprice02

Description

@cdprice02

Handle Unix signals correctly for a robust interactive shell.

Behavior:

  • SIGINT (Ctrl+C): forward to foreground process group, don't kill the shell
  • SIGTSTP (Ctrl+Z): suspend foreground process, return control to shell
  • SIGCHLD: reap completed background jobs
  • Provide clear feedback (e.g., print newline after Ctrl+C, don't leave prompt broken)

Per ferrish's explicit over implicit principle, signal behavior should be predictable and visible.

Platform note: This is primarily Unix/macOS. On Windows, consider graceful no-ops or platform-specific alternatives.

Acceptance criteria:

  • Ctrl+C doesn't kill the shell
  • Ctrl+Z suspends foreground process
  • Background jobs are reaped via SIGCHLD
  • User gets clear feedback on signal delivery
  • Windows builds compile cleanly (graceful degradation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions