#1150142 dash: does not (re)set the terminal to cooked mode

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Vincent Lefevre
Date:
2026-10-06 00:57:02 UTC
Severity:
normal
#1150142#5
Date:
2026-10-06 00:54:07 UTC
From:
To:
A command started from an interactive shell may set the terminal to
raw mode for its own use. It usually resets it to cooked mode before
terminating, but one should not rely on that because the process may
crash or be killed.

All shells seem to (re)set the terminal to cooked mode to handle
that... except dash!

Example: execute

  sh -c 'echo $$; stty raw; sleep 30; stty -raw'

from various shells, and kill sh (the output pid). Only with dash,
the terminal remains in raw mode.