From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Greatwood Newsgroups: gmane.emacs.bugs Subject: bug#72450: 29.1; Tramp Failed to Parse OS Name and Version for Windows 11 Date: Thu, 8 Aug 2024 12:03:45 -0700 Message-ID: References: <86y15cucg3.fsf@gnu.org> <87frrkk7ze.fsf@gmx.de> <867ccwsl77.fsf@gnu.org> <87bk28k1yy.fsf@gmx.de> <8634nksh16.fsf@gnu.org> <877ccwk142.fsf@gmx.de> <861q34sgb3.fsf@gnu.org> <874j7zpe62.fsf@gmx.de> <95069f51-923e-657c-ead4-ee20c634fb65@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004cca9e061f30b0a6" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29635"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgbulk@gmail.com, Eli Zaretskii , Michael Albinus , 72450@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 08 21:05:58 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sc8SS-0007Yt-WB for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Aug 2024 21:05:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sc8SD-0001Fn-4P; Thu, 08 Aug 2024 15:05:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sc8S8-0001FC-WF for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 15:05:37 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sc8S8-00089K-Mi for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 15:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=XLO01wGbqtEpzuX+H22O/ig+imcnaUoBhKXMAowM+D8=; b=LpvWqUZyW3f+RnhV1U8CPU6pknWxijAFK2JjdvKSQhX4RipH9qne7GTOLXMAcybzSeBBGTEoE+QAKKzisLo3wEnp9OlmgtNMkHQ21KI7yL34jfbS304dTx0fiNPPLADIFJDqkJKwwSAEwKuDB7naQvZTrTXRcM77G5e7O6jzGDdhx0T3VcWvvcEL2n4fVSmik549Kcfd2Z1P6qeD93/GgpJzz9xG5s5LoFpXiNjsY3C4BVcJA0xxrcf1BgnTkZ9V3M7I7TyUXdCRFeAa85znOZ5OMnNwfUtVBTMq0K0JRgZKoiMqbc06oW5Qhf4F5IGM04+vBcifWHkckUbWyN+c3A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sc8SY-0003h4-FH for bug-gnu-emacs@gnu.org; Thu, 08 Aug 2024 15:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Duncan Greatwood Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Aug 2024 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72450 X-GNU-PR-Package: emacs Original-Received: via spool by 72450-submit@debbugs.gnu.org id=B72450.172314393614157 (code B ref 72450); Thu, 08 Aug 2024 19:06:02 +0000 Original-Received: (at 72450) by debbugs.gnu.org; 8 Aug 2024 19:05:36 +0000 Original-Received: from localhost ([127.0.0.1]:37200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sc8S7-0003gG-E1 for submit@debbugs.gnu.org; Thu, 08 Aug 2024 15:05:36 -0400 Original-Received: from mail-ed1-f48.google.com ([209.85.208.48]:49166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sc8S4-0003g0-Tz for 72450@debbugs.gnu.org; Thu, 08 Aug 2024 15:05:33 -0400 Original-Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5bba25c1e15so1558215a12.2 for <72450@debbugs.gnu.org>; Thu, 08 Aug 2024 12:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143839; x=1723748639; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XLO01wGbqtEpzuX+H22O/ig+imcnaUoBhKXMAowM+D8=; b=Wtw4HNbWArpWHnTby35FLDDLr4AwIpapoUkdT/H2M3QwPytwW7/FRhnCRT0CYj/wCv XOseyd1osH1qlIlHbegl/OHGgCAOz4YA4OEHlIIaIcfDF2ZTnpQAAcQUvGkx7hRqHV9w DinXBu9jVHD2ZTfXnJf6g77U6PutWMmm6xC1cg9qYzgzdsLgFdNnH8ceotwo1oSNeHu/ DHXkEelXRD8TNUtCr380YEQjNUsnVOYmLG5Guffvd//eDEx8nDS4o0eddNObbDtSyFhX Dg1PVZkJOh0WxOPufPRboIk8rqK6PIJYYeiCArMk1DV6kDTIAUvr+qIgPugzDpQbbpPl 3aYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143839; x=1723748639; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XLO01wGbqtEpzuX+H22O/ig+imcnaUoBhKXMAowM+D8=; b=VPaV6GaIunW23enoiSXjFieBZDeX15n2+vdXWlKSBGPa7g0g0QYu3gmhrd4hejALbl LHAlKNoblhD451TSWqByzPQxr9Zgembj3SvpkgugRKi+dUCGKgguLlQiRPgHcST0RiSY FLtGd/6/nZ35D6UvGCQ5PQZXmZLc6jmB3aLz/qUWvuK4BknrXH4ygV/VUn06jEar1dhh 5SQP+jjUrPDV4pVV4S2Jx/3MiacqZYe9o69crgPI6wIUtyXlXeqrWtX5JX+S+MO7QggH VZodTC3CXh3Roehpsm6w16D1/pLpEJL8NZjEHefleZkOD+yuE1ONPM40bcvv/j6EUWLk 29Ig== X-Forwarded-Encrypted: i=1; AJvYcCUcEJOBW8J362OyxpyeaNyLMAf9zfS8xPbDTzFhCi5Rm5JHXsv/OGqylS8+fO5giZ5KfFgDto8M/pWtGrLTrTGuOdaRIrQ= X-Gm-Message-State: AOJu0YxtTMaf7Ys0msDPGH6A6VIXprQ+wX/Hy0cP6Iwj0UIqqlFRlVJr R5w4UPIbnNXVKP84zRKSqKpqOeuzIqyOQcn5YqT+ISZKSxak6dz2hPNAQVIulyE= X-Google-Smtp-Source: AGHT+IGLrrOFkp9yyfEMCK2uXhU0eJZzhWeTESJPmesknkC08UPW7JhP5zgmHJV4bogabQ7Tag5ZWQ== X-Received: by 2002:a05:6402:1d48:b0:5a1:eb48:2b9a with SMTP id 4fb4d7f45d1cf-5bbb233a91amr2331577a12.25.1723143838195; Thu, 08 Aug 2024 12:03:58 -0700 (PDT) Original-Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com. [209.85.208.48]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5bbb2c73911sm902477a12.58.2024.08.08.12.03.57 for <72450@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 12:03:57 -0700 (PDT) Original-Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5bba25c1e15so1558152a12.2 for <72450@debbugs.gnu.org>; Thu, 08 Aug 2024 12:03:57 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVCzPgEegjC7kCbhyalT6miBueJ8EjGB6Kej0yF9DtKYJ4AWRgmrZpzgeHCiWONj4Jgvfr8UfId7KyIBk6fxJQjFcLE4Ks= X-Received: by 2002:a17:907:f18e:b0:a7d:c46b:2241 with SMTP id a640c23a62f3a-a8090db06bemr234769166b.29.1723143836969; Thu, 08 Aug 2024 12:03:56 -0700 (PDT) In-Reply-To: <95069f51-923e-657c-ead4-ee20c634fb65@gmail.com> X-Gmail-Original-Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289951 Archived-At: --0000000000004cca9e061f30b0a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Jim - Yes that does sound similar. All - I might try and register a bug/request with MSFT. If it's easy to do so, are you able to point me to the POSIX requirement that specifies "If TERM is set to "dumb", don't be prepending the prompt with the job name, inserting control characters, or otherwise messing with it?" If you understand my question. Maybe MSFT can give a config option at least. Thanks, Duncan On Thu, Aug 8, 2024 at 11:28=E2=80=AFAM Jim Porter = wrote: > On 8/5/2024 1:27 AM, Michael Albinus via Bug reports for GNU Emacs, the > Swiss army knife of text editors wrote: > > Duncan Greatwood writes: > > > >> Hi Michael and Eli - > > > > Hi Duncan, > > > >> sh-5.2$ uname --version > >> uname (GNU coreutils) 8.32 > >> Copyright (C) 2020 Free Software Foundation, Inc. > >> License GPLv3+: GNU GPL version 3 or later > >> . > >> This is free software: you are free to change and redistribute it= . > >> There is NO WARRANTY, to the extent permitted by law. > >> > >> Written by David MacKenzie. > >> sh-5.2$ > >> > >> If I may, the extra characters in the emacs error message might not > >> come from the uname on windows - that uname seems to work OK on the > >> windows side at least - it could be a misparsing in emacs (or even an > >> mistake gathering the error message, I suppose). > > > > I also don't believe it comes from uname itself. '[17;120H=E2=80=99' lo= oks > > rather like an escape code sequence, perhaps emitted from the underlyin= g > > shell. Something like cursor position, window setting, whatever. A > > search didn't gave me a clue what's this. > > > > After connecting the remote host via ssh, Tramp sends as very first > > command something like > > > > --8<---------------cut here---------------start------------->8--- > > # exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8.0-pre' ENV= =3D'' > HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D'' > PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS3=3D'' /bin/sh = -i > > --8<---------------cut here---------------end--------------->8--- > > > > Note the TERM=3D'dumb' setting, which ought to suppress such code > > sequences. > > > > Somehow, this doesn't seem to work as expected in your case. Perhaps du= e > > to calling /bin/sh. See below for debugging instructions. > > Regarding the unusual cursor-positioning ANSI sequences, I may know what > this is, since I encountered something similar before: > . > > This is apparently just another one of those sharp corners on MS-Windows > that we have to deal with for the sake of backwards compatibility > (nice), but that there's no clear way to opt out of (not so nice): > . > > >> From an emacs perspective, it seems a shame not to be able to use ssh= , > >> given that modern Windows commonly supports ssh and provides a bash > >> shell. Depending on your own available bandwidth etc. of course. > > > > That is NOT a shame. MS Windows is a non-free operation system, > > therefore it isn't a primary target for Emacs development. > > > > And it doesn't seem to be important. I'm working for Tramp for more tha= n > > 20 years. During this time, nobody has contributed anything for the sak= e > > of MS Windows. And I don't use MS Windows myself; if possible, I fix > > things, that's it. > > Well, I've tried to help make Tramp work a bit better on MS-Windows (my > first Emacs patch was to fix Tramp hostname completion on MS-Windows > ;)), but this bug is the one where I finally gave up: there's a point > where trying to fix Microsoft's mistakes just becomes too time-consuming > and bothersome, so I focused my energies elsewhere. > > As it's been a few years since I looked at this last, the residual > irritation has certainly subsided so I wouldn't mind trying to help out > in some way, but I'm not sure I have the patience to come up with a > patch for this myself. > --=20 NOTICE: This email and its attachments may contain privileged and=20 confidential information, only for the viewing and use of the intended=20 recipient. If you are not the intended recipient, you are hereby notified= =20 that any disclosure, copying, distribution, acting upon, or use of the=20 information contained in this email and its attachments is strictly=20 prohibited and that this email and its attachments must be immediately=20 returned to the sender and deleted from your system. If you received this= =20 email erroneously, please notify the sender immediately.=C2=A0 Xage Securit= y,=20 Inc. and its affiliates will never request personal information (e.g.,=20 passwords, Social Security numbers) via email.=C2=A0 Report suspicious emai= ls to=20 security-alerts@xage.com --0000000000004cca9e061f30b0a6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Jim - Yes that does sound similar.

All = - I might try and register a bug/request with MSFT. If it's easy to do = so, are you able to point me to the POSIX requirement that specifies "= If TERM is set to "dumb", don't be prepending the prompt with= the job name, inserting control characters, or otherwise messing with it?&= quot;=C2=A0

If you understand my question.=C2=A0

Maybe MSFT can give a config option at least.
=
Thanks,
Duncan


On Thu, Aug 8, 2024 at 11= :28=E2=80=AFAM Jim Porter <jpor= terbugs@gmail.com> wrote:
On 8/5/2024 1:27 AM, Michael Albinus via Bug reports for G= NU Emacs, the
Swiss army knife of text editors wrote:
> Duncan Greatwood <dgreatwood@gmail.com> writes:
>
>> Hi Michael and Eli -
>
> Hi Duncan,
>
>>=C2=A0 =C2=A0 =C2=A0 sh-5.2$ uname --version
>>=C2=A0 =C2=A0 =C2=A0 uname (GNU coreutils) 8.32
>>=C2=A0 =C2=A0 =C2=A0 Copyright (C) 2020 Free Software Foundation, I= nc.
>>=C2=A0 =C2=A0 =C2=A0 License GPLv3+: GNU GPL version 3 or later
>>=C2=A0 =C2=A0 =C2=A0 <https://gnu.org/licenses/gpl.html<= /a>>.
>>=C2=A0 =C2=A0 =C2=A0 This is free software: you are free to change = and redistribute it.
>>=C2=A0 =C2=A0 =C2=A0 There is NO WARRANTY, to the extent permitted = by law.
>>
>>=C2=A0 =C2=A0 =C2=A0 Written by David MacKenzie.
>>=C2=A0 =C2=A0 =C2=A0 sh-5.2$
>>
>> If I may, the extra characters in the emacs error message might no= t
>> come from the uname on windows - that uname seems to work OK on th= e
>> windows side at least - it could be a misparsing in emacs (or even= an
>> mistake gathering the error message, I suppose).
>
> I also don't believe it comes from uname itself. '[17;120H=E2= =80=99' looks
> rather like an escape code sequence, perhaps emitted from the underlyi= ng
> shell. Something like cursor position, window setting, whatever. A
> search didn't gave me a clue what's this.
>
> After connecting the remote host via ssh, Tramp sends as very first > command something like
>
> --8<---------------cut here---------------start------------->8--= -
> # exec env TERM=3D'dumb' INSIDE_EMACS=3D'31.0.50,tramp:2.8= .0-pre' ENV=3D'' HISTFILE=3D~/.tramp_history PROMPT_COMMAND=3D&= #39;' PS1=3D///245adade605348c086dac6d8f612435c\#\$ PS2=3D'' PS= 3=3D'' /bin/sh=C2=A0 -i
> --8<---------------cut here---------------end--------------->8--= -
>
> Note the TERM=3D'dumb' setting, which ought to suppress such c= ode
> sequences.
>
> Somehow, this doesn't seem to work as expected in your case. Perha= ps due
> to calling /bin/sh. See below for debugging instructions.

Regarding the unusual cursor-positioning ANSI sequences, I may know what this is, since I encountered something similar before:
<
https://lists.gnu.org/archiv= e/html/tramp-devel/2021-04/msg00024.html>.

This is apparently just another one of those sharp corners on MS-Windows that we have to deal with for the sake of backwards compatibility
(nice), but that there's no clear way to opt out of (not so nice):
<https://github.com/PowerShell/Win32-OpenS= SH/issues/1738>.

>>=C2=A0 From an emacs perspective, it seems a shame not to be able t= o use ssh,
>> given that modern Windows commonly supports ssh and provides a bas= h
>> shell. Depending on your own available bandwidth etc. of course. >
> That is NOT a shame. MS Windows is a non-free operation system,
> therefore it isn't a primary target for Emacs development.
>
> And it doesn't seem to be important. I'm working for Tramp for= more than
> 20 years. During this time, nobody has contributed anything for the sa= ke
> of MS Windows. And I don't use MS Windows myself; if possible, I f= ix
> things, that's it.

Well, I've tried to help make Tramp work a bit better on MS-Windows (my=
first Emacs patch was to fix Tramp hostname completion on MS-Windows
;)), but this bug is the one where I finally gave up: there's a point <= br> where trying to fix Microsoft's mistakes just becomes too time-consumin= g
and bothersome, so I focused my energies elsewhere.

As it's been a few years since I looked at this last, the residual
irritation has certainly subsided so I wouldn't mind trying to help out=
in some way, but I'm not sure I have the patience to come up with a patch for this myself.

NOTICE: This email and its attachmen= ts may contain privileged and confidential information, only for the viewin= g and use of the intended recipient. If you are not the intended recipient,= you are hereby notified that any disclosure, copying, distribution, acting= upon, or use of the information contained in this email and its attachment= s is strictly prohibited and that this email and its attachments must be im= mediately returned to the sender and deleted from your system. If you recei= ved this email erroneously, please notify the sender immediately.=C2=A0 Xag= e Security, Inc. and its affiliates will never request personal information= (e.g., passwords, Social Security numbers) via email.=C2=A0 Report suspici= ous emails to security= -alerts@xage.com
--0000000000004cca9e061f30b0a6--