On 10/27/25 5:42 PM, Rudi Horn wrote:
On 27/10/2025 20:29, Chet Ramey wrote:This is the part I don't get. It's not bash that sets the shell to raw mode, since there's not a tty in the mix, so it must be something in how it's invoked, or another program that sets the terminal modes and then execs bash.In my setup when invoking `ssh -q -o ControlPath=none -tt -o "RemoteCommand=bin/sh -i" <host>` seems to be creating a tty and that tty is also set to canonical mode. If I then feed it two nested shells it looses output. A simple example of this is:``` /bin/sh --noediting -i /bin/sh --noediting -c 'cat -' Lorem ipsum ... ```Then some amount of the sent data which should be printed by the `cat` gets lost. Throwing in some `stty`'s here and there seems to reveal that the tty does actually remain in canonical mode when the subshells are invoked, so I'm actually a bit confused why there are problems here.
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.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature
