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: Multi-tty Date: Fri, 08 Nov 2024 10:50:18 +0200 Message-ID: <868qtup0s5.fsf@gnu.org> References: <8634k3qpie.fsf@gnu.org> <87r07nl2gf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31995"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 08 09:51:57 2024 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 1t9Kii-00086i-QJ for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Nov 2024 09:51:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9KhF-0004hK-8N; Fri, 08 Nov 2024 03:50:26 -0500 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 1t9KhC-0004gb-DT for emacs-devel@gnu.org; Fri, 08 Nov 2024 03:50:22 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9KhA-0000yM-VP; Fri, 08 Nov 2024 03:50:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=eWlCpoq1E+gfA8k5SSviOYTQdD1Y0Kkp3CHVWbwnwdA=; b=ndd5j/sCek40LJ1bqONP +sHTeIRoLZxcuCjCSGXhsgChZSrQOfbnEM6/I70Q0obJjMcRqnM1r3sqmOGVydcn/JmegRipCfxYD Q1YbQ+uSf8WRyfUrKoCAYp5MEmPCQvidoZIzMFXW6b2Do+QA+DfaoDU8pTmK5RhtLpDoF57RsSyIQ iHw2eDOue6OiCnUiyd3GYlonxdYb/F13xSk/rANOfcJJBWTkiiPDgiWoGEyI9K44Z+z4VaatcvnWh GV9iiWVW0sUEjEgR+RqHbaUyLxWS/DGXvnBrkJH1OSHSr57kf8gRVjEa6K+YG5hPBtzmks+a9CSMk +BONbrQpHspBYw==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Fri, 08 Nov 2024 09:18:05 +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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325261 Archived-At: > From: Gerd Möllmann > Cc: Eli Zaretskii , emacs-devel@gnu.org > Date: Fri, 08 Nov 2024 09:18:05 +0100 > > > Eli> This is simply not supported, never was. The environment variables > > Eli> are not per-terminal, so their effect is global, and the way we > > Eli> process them (and have no other way) is that the environment variables > > Eli> override what terminfo tells us. > > > > They do, but then they change the settings in the per-terminal > > tty_display_info, no? Or am I misreading init_tty? Certainly > > > > TERM=xterm-mono emacsclient -tty > > > > gives me a mono emacs. > > And TERN works because emacsclient picks it up and sends its value as > part of the frame creation command to the server. In the server, it is > then passed down to make_terminal_frame as a frame parameter which > itself uses it for init_tty. Yes, exactly. But TERM is special in this sense. > A pretty easy fix would be to make the environment that we got from > emacsclient anyway another frame parameter. Then init_tty wouldn't have > to use getenv to get the value of COLORTERM. I'm not sure this is easy. The general problem of environment variables being terminal-specific (_not_ frame-specific!) was discussed at length around the introduction of multi-tty into Emacs, but AFAIR the decision was eventually to leave that unsolved, due to non-trivial difficulties whose details I no longer recall. You may wish looking up those discussions, around 2003 to 2007 (look for messages posted by Károly Lőrentey, who implemented multi-tty in Emacs). Or maybe Stefan remembers those discussions better.