From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: PTYs vs. pipes for subprocesses [was: Tramp and conversion of \r\n into \n] Date: Sun, 8 Aug 2021 08:13:39 +0200 Message-ID: <20210808061339.GB19428@tuxteam.de> References: <8736014u95.fsf@gmx.de> <3474731f-eada-8185-1a21-f337fd55b38b@thomasross.io> <87k0kzj3wr.fsf@gmx.de> <87a6lvhwpz.fsf@gmx.de> <875ywhicr4.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31128"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 08 08:14:38 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 1mCc4z-0007vG-S1 for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Aug 2021 08:14:37 +0200 Original-Received: from localhost ([::1]:46878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCc4x-0004cy-V1 for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Aug 2021 02:14:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCc47-0003y8-UV for emacs-devel@gnu.org; Sun, 08 Aug 2021 02:13:44 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:46129) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1mCc45-0007X9-Iq for emacs-devel@gnu.org; Sun, 08 Aug 2021 02:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=8l2nb6C1rNJn5xOV2GscHKALKRTG4O4H0B2GJiwChYY=; b=W+QF8+EWfvUK1Vvxlv5caVoyMBguAOoT9z94XuUfVKADVPFn4avtQHBe9/dIMRokJgZNfLIUkjP6pDRE+/DePcHFsT0YPoKbh2gqxuHfJKZWofn6wRE6GHTgMiWgotlH3WhUDtW/Av6KNz1sAdhrTw+KDOiZFkaIX2lQwoHgzYicBqiu3SLUf+5KR7NLaUpgysbJCjqB5SztH6Fe3hSqQoW0Ej3cWMXyG1RE6G0Q4Dg/5AHWQs0bu6963phl2qn/BKXf8b1JOXPXHDepKM063sRkxdzqmusbV5PiMEdCYObCsXgrshO2Pw4KQXC0VxOxsTEQYFWaRELyv2A+Rnrv4g==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1mCc43-0005Pj-Ax for emacs-devel@gnu.org; Sun, 08 Aug 2021 08:13:39 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:272191 Archived-At: --jho1yZJdad60DJr+ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi, another thing which has bitten me going from PTYs to pipes (specifically because I wanted to have stderr in a separate channel - that part worked nicely), is that the callee "sees" that, thinks "oh, I'm not being called interactively [1] and disables line buffering. Interactivity goes out of the window. Not always welcome :-) I "solved" that by invoking the callee through stdbuf. I didn't know this even existed before. And it's ugly [2] and won't work always. I don't dare yet to use that in other than toy applications (and, of course, to get yourself out of the occasional hard spot). Cheers [1] probably the classical isatty(3) dance. [2] it basically works by sneaking itself into LD_PRELOAD Not that I'm not thankful for someone providing that, mind you. But it's not the typical "for production" thing, I'd say. - t --jho1yZJdad60DJr+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmEPdhMACgkQBcgs9XrR2kYeFQCeM4OrIBx0iWZ4sTHfeXwdC22G EO4An1HkvEI534zqj89Jv1Wu9We5btB3 =HIrY -----END PGP SIGNATURE----- --jho1yZJdad60DJr+--