On 28/10/2025 17:48, Chet Ramey wrote:
It's the pipe to a shell instance that's forced interactive. If that shell
were reading from a tty in icanon mode, the kernel would break lines at
the tty eol character (newline). That much seems clear.
My new minimal example is now the following:
```
ssh -o ControlPath=none -tt -o "RemoteCommand=stty -icanon; stty icanon;
strace -e read cat -" <host> <<EOF
hello
world
```
Seemingly, switching this pseudo terminal to non-canonical mode and then
back to canonical mode is sufficient to break canonical mode. Removing
the `stty -icanon` causes strace to report the correct canonical
behaviour. Given I can replicate this without bash, it seems to be a
kernel issue. It is also not behaviour I can replicate on all machines
(e.g. Ubuntu 22.04.4 LTS seems to not be affected). I'll see if I can
find other systems affected...
Thanks,
Rudi