Subject: bug#37953: closed (Re: bug#37953: tramp: a local bash does not start)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 28 Oct 2019 08:57:03 +0000

Your bug report

#37953: tramp: a local bash does not start

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
37953: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37953
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#37953: tramp: a local bash does not start
From: Michael Albinus <[email-masked]>
To: Koichi Arakawa <[email-masked]>
Cc: [email-masked]
Date: Mon, 28 Oct 2019 09:55:44 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 27.1

Koichi Arakawa <[email-masked]> writes:

> Hi

Hi,

> I'm using Emacs in the MSYS2 environment. And the local shell bash
> depends on the order of its command-line switches.
>
> When the last argument is "-i", bash starts normally.
>
>     >C:/msys64/usr/bin/bash -norc -noprofile -i
>     bash-4.4$
>
> But in another case, it ends with an error.
>
>     >C:/msys64/usr/bin/bash -i -norc -noprofile
>     /usr/bin/bash: line 0: /usr/bin/bash: -noprofile: invalid option name
>
> So I think we need the following patch to fix that.

Thanks for the report, the same error happens on GNU/Linux. So I have
applied your patch to the repositories. Closing the bug.

> Best regards,
> Koichi Arakawa

Best regards, Michael.

Subject: tramp: a local bash does not start
From: Koichi Arakawa <[email-masked]>
To: [email-masked]
Date: Mon, 28 Oct 2019 09:07:13 +0900(東京 (標準時))
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi

I'm using Emacs in the MSYS2 environment. And the local shell bash
depends on the order of its command-line switches.

When the last argument is "-i", bash starts normally.

    >C:/msys64/usr/bin/bash -norc -noprofile -i
    bash-4.4$

But in another case, it ends with an error.

    >C:/msys64/usr/bin/bash -i -norc -noprofile
    /usr/bin/bash: line 0: /usr/bin/bash: -noprofile: invalid option name

So I think we need the following patch to fix that.

Best regards,
Koichi Arakawa

--- tramp-sh.el.~1~     2019-10-20 10:48:27.300959800 +0900
+++ tramp-sh.el 2019-10-28 08:47:12.048207800 +0900
@@ -4877,9 +4877,9 @@
                           (tramp-get-connection-buffer vec)
                           (append
                            (list tramp-encoding-shell)
+                           (and extra-args (split-string extra-args))
                            (and tramp-encoding-command-interactive
-                                (list tramp-encoding-command-interactive))
-                           (and extra-args (split-string extra-args)))))))
+                                (list tramp-encoding-command-interactive)))))))

                ;; Set sentinel and query flag.  Initialize variables.
                (set-process-sentinel p #'tramp-process-sentinel)