Subject: bug#62093: [PATCH] Let processes read nothing from stdin in tramp

From: Aleksander Trofimowicz <[email-masked]>
Date: Fri, 17 Nov 2023 20:10:34 +0000

Hi Michael,

Michael Albinus <[email-masked]> writes:

> I cannot speak for the local case. But in Tramp, we need to set "stty
> -icanon ..." for the pipe connection type in order avoid blocking
> situations with larger hunks of data, see the comment there. And the use
> case of magit-start-process would be better with the connection type
> pty, at least when calling Tramp.
>
Re-configuring a TTY device via "-icanon" does not only lift the 4k input
line limit; there are other far-reaching consequences. Most notably: a
handful of the terminal special characters are delivered straight to
stdin of a managed process, which more often than not is unprepared to
handle such a situation (e.g. the VEOF character). I would argue in the
Tramp context doubly so, since the connection-type is set to 'pipe'
somewhere up in a stack. It also invalidates certain expectations most
people have while invoking process-send-eof.

These are reasons magit stopped working, and my patch was a half-baked
attempt to address the problem by other means. Please drop it. At the
same time I would encourage you to revert the change that introduced the
noncanonical mode, since the current state is very confusing and breaks
existing code. A dedicated defcustom should cater for those who deal
with large input data.

Ideally no pty should be allocated if one asks for 'pipe' (by employing
ssh connection multiplexing?).
--
Kind regards,
at