Subject: bug#41099: 28.0.50; TRAMP process-file ignores exit status of remote process

From: Michael Albinus <[email-masked]>
Date: Thu, 14 May 2020 17:49:40 +0200

Philipp Stephani <[email-masked]> writes:

Hi Philipp & Noam,

>> >> - we don't return a string in case a signal has interrupted the process,
>>
>> Since we don't have a reliable way to detect signals, I think this is
>> the only viable option.
>
> I'd expect the vast majority of programs to avoid such exit codes,
> precisely because they would want to allow portable usage in shell
> scripts. So I expect that the current behavior in master provides the
> "correct" result in the majority of cases.

I understand (and sympathize) both positions. However, Tramp has
returned for decades no strings for process-file, so I don't expect any
code in the wild which expects this.

What about a user option, tramp-process-file-return-signal-string? If
non-nil, it returns a string when a signal is assumed for exit codes >
128. If nil (the default), the exit code is always returned as
natnum. This would also fit the principle of least surprise, because
Tramp hasn't returned strings since ever.

A better variable name would also be appreciated :-)

Best regards, Michael.