From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thomas Ross Newsgroups: gmane.emacs.devel Subject: Re: Tramp and conversion of \r\n into \n Date: Fri, 6 Aug 2021 22:07:04 -0400 Message-ID: References: <193e76e900f64f01a39893b12cf7c4ff@3ds.com> <871rfw900w.fsf@gmx.de> <87sg8c7i5w.fsf@gmx.de> <4f2b42e36d924f83883e120e601d40f7@3ds.com> <87tuslzrw1.fsf@gmx.de> <7135a39a200c4f8397c8bddb9da8d3fc@3ds.com> <8736014u95.fsf@gmx.de> <3474731f-eada-8185-1a21-f337fd55b38b@thomasross.io> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5020"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Cc: "emacs-devel@gnu.org" , Michael Albinus , yyoncho , APEL Martin To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 07 07:17:52 2021 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 1mCEiW-0001Bg-19 for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Aug 2021 07:17:52 +0200 Original-Received: from localhost ([::1]:36000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCEiU-00071u-ST for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Aug 2021 01:17:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCBjx-0004ye-3k for emacs-devel@gnu.org; Fri, 06 Aug 2021 22:07:09 -0400 Original-Received: from smtp116.ord1d.emailsrvr.com ([184.106.54.116]:44933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCBjv-0006ML-Fv for emacs-devel@gnu.org; Fri, 06 Aug 2021 22:07:08 -0400 X-Auth-ID: thomasross@thomasross.io Original-Received: by smtp23.relay.ord1d.emailsrvr.com (Authenticated sender: thomasross-AT-thomasross.io) with ESMTPSA id 45D412010F; Fri, 6 Aug 2021 22:07:05 -0400 (EDT) In-Reply-To: Content-Language: en-US X-Classification-ID: 5aa6f77d-c3b7-4558-a24b-24bec3520c97-1-1 Received-SPF: pass client-ip=184.106.54.116; envelope-from=thomasross@thomasross.io; helo=smtp116.ord1d.emailsrvr.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-2.619, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 07 Aug 2021 01:16:58 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:272153 Archived-At: > Try to add `:connection-type 'pipe` to see the difference (you may also > have to add a call to `process-send-eof` to flush the send buffer, IIRC). Yep, looks like you're right. `:connection-type 'pipe` fixes this on my local machine. It does not, however, fix it over TRAMP (and let-binding tramp-process-connection-type to 'pipe doesn't change that): > (make-process :name "hexdump" :command '("hexdump" "-v" "-e" "/1 \"%02X\n\"") :buffer "hexdump" :connection-type 'pipe :file-handler t) > (process-send-string "hexdump" "abc\r\n" > 61 > 62 > 63 > 0A > 0A It's also interesting to note that `(process-send-eof "hexdump")` is required to get output on my local machine, but it's not required over TRAMP. Independent of this apparent TRAMP bug, lsp-tramp-connection will likely need to be modified to use connection-type 'pipe. Currently it uses start-file-process-shell-command (which calls start-file-process, which calls start-process, which calls make-process), and uses the default connection-type. Thanks, Thomas. On 2021-08-05 10:10 a.m., Stefan Monnier wrote: >>> (make-process :name "hexdump" :command '("hexdump" "-v" "-e" "/1 \"%02X\n\"") :buffer "hexdump") >>> (process-send-string "hexdump" "abc\r\n") >> >> on my system (Linux, Emacs 27.1): >> >>> 61 >>> 62 >>> 63 >>> 0A >>> 0A > > What you're seeing here is the effect of the use of a tty (i.e. the > conversion or \r to \n is done by the tty rather than by Emacs). > > Try to add `:connection-type 'pipe` to see the difference (you may also > have to add a call to `process-send-eof` to flush the send buffer, IIRC). > > > Stefan >