From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MS Windows: ConPTY -- can cmdproxy be patched to allow PTY for cmd (or "windows-bash")? Date: Sun, 20 Feb 2022 09:05:29 +0200 Message-ID: <83czjixbk6.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18667"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Thomas Schwanberger Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 20 08:06:10 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nLgIL-0004eI-32 for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Feb 2022 08:06:09 +0100 Original-Received: from localhost ([::1]:48696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLgIJ-00040l-HN for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Feb 2022 02:06:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLgHh-0003I2-6V for emacs-devel@gnu.org; Sun, 20 Feb 2022 02:05:29 -0500 Original-Received: from [2001:470:142:3::e] (port=51558 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLgHg-0003eL-SN; Sun, 20 Feb 2022 02:05:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=t9CoG69WMQRo3Wf84O1//CXlKUUFuxRFIbyHrXt7hVg=; b=cMaTvAbrl048 7yBhswov8U3aUlZLIlTAUv1gwXP50LawLejENtCRUrI/rDYXKkvKl2lUL/exBuqXcNtwkGn+aF985 ggH5lk2rhBQ3r89Opba6NQyerB/GZ3K5AK8Cu5HtZKI3Z7CyJl2Ql+ZJXWW1SV8zMoyqekcSYTtCv 1CfkRs2XWdNjqUmPaUsFmFHGbNXY4LZiNGesE4HnhjlzedJ/GTmARzEc3kH6UTPT4UTULba0GOOl3 kwelwOMtXso9nBIORu4v2KlaWgiklnmJgcEv2ObwanyqFc15fyM+IA4UsB1aA7WoFxFX1t8cLIZb0 JkMgnBJ689rlODN4A2oriQ==; Original-Received: from [87.69.77.57] (port=2463 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLgHg-0007Tb-2c; Sun, 20 Feb 2022 02:05:28 -0500 In-Reply-To: (message from Thomas Schwanberger on Sat, 19 Feb 2022 22:11:51 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286507 Archived-At: > From: Thomas Schwanberger > Date: Sat, 19 Feb 2022 22:11:51 +0100 > > Quick background: > I'm forced to use MS Windows at work. In order to use tramp with my MSYS > emacs 28.0.91 build for operating remote servers I have to do either of: > > - plink > - fakecygpty with cygwin bash to simulate native "ssh" with only minor > annoyances What is "MSYS emacs"? For MS-Windows, Emacs supports 3 configurations: . "native" MS-Windows build with MinGW tools . Cygwin-X build with X toolkits . Cygwin-w32 build with the MS-Windows "w32 GUI toolkit" Which one of these are you running? > The last option is working rather well for me, but seeing as MS Windows has > recently made some PTY strides ( > https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/ > ) > > Is there any plans to make use of this in w32-emacs? I presume a patch to > cmdproxy might make PTY available. Is it even possible? -- I'm far out of > my depth here and my presumption might be trivially false -- even so, > please elaborate, if you please. Unfortunately, ConPTY has a serious problem which precludes its useful integration into Emacs as an emulation of Posix PTYs. At the time, I filed an issue with MS-Windows developers describing the problem, see https://github.com/microsoft/terminal/issues/9174. The root cause of this problem, as always with Windows, is that Windows I/O is not agnostic to the encoding, it doesn't regard the sent/received stuff as a stream of bytes, but instead actively translates those bytes to present to each application the encoding it expects (according to what Windows thinks). Without some reasonable resolution of these issues, we cannot use ConPTY in Emacs.