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.help Subject: Re: How does Emacs select the "-nw" terminal Date: Sat, 15 May 2021 09:59:34 +0200 Message-ID: <20210515075934.GA27312@tuxteam.de> References: <4FhxwF3bpSz6tmG@submission01.posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8262"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 15 10:00:24 2021 Return-path: Envelope-to: geh-help-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 1lhpDk-0001xb-01 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 10:00:24 +0200 Original-Received: from localhost ([::1]:41090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhpDj-0000Pn-1y for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 04:00:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhpD9-0000Lz-M8 for help-gnu-emacs@gnu.org; Sat, 15 May 2021 03:59:47 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:50951) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1lhpD7-0003uX-FI for help-gnu-emacs@gnu.org; Sat, 15 May 2021 03:59:47 -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=0ScYZaBtq3XPeTNc6KVBvZvLAE+qK285gtOk4jvJYLk=; b=p907i/2hEt0bkeKm4augt2/o30WdHIc7d8fDVGIRt5DYBwJm4U8PmyoVvs/LZK+F7L5cBwmRFhSzelIGNBwic7sa8meUvVTDLYzXK0n+TcPxDsTzzvcwFJUIUMX4174366hzPrC+q1B686kzKb16USWBeZC2K1HmFLLhopB9EijE1ZTcBHADWWvQiUbsQgGh6MMmwUqiH327HdQAWFHBlAzVHfDGyYPyeszrDZgWOGM+p2BqB4dzyAITzq/WgQ13TVz1DOow4xnm1Y7CYOCiRwxVtamn3gDty/YapWcQPaFYRmY+KLVtlE8pILbGRpE4YYKpgtVz76XXZcAe00+8ZQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1lhpCw-0007ec-2a for help-gnu-emacs@gnu.org; Sat, 15 May 2021 09:59:34 +0200 Content-Disposition: inline In-Reply-To: <4FhxwF3bpSz6tmG@submission01.posteo.de> 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:129789 Archived-At: --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 15, 2021 at 07:33:45AM +0000, c.buhtz@posteo.jp wrote: > Hello, >=20 > I am using >=20 > GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of > 2021-01-31, modified by Debian >=20 > in Debian 10 (stable). >=20 > My question is if and how Emacs itself decide in which terminal > emulation it opens when started via "emacs -nw" in a desktop > environment (e.g. Xfce). > And can I manipulate that? You have to talk to your desktop environment for that. Emacs takes the terminal it's started in -- it doesn't get to choose. > The background of my question: > When I open the context menu of a file in my Xfce filemanager Thunar > the "Open with..." sub-context-menu offers me "Emacs (GUI)" and "Emacs > (Terminal)". >=20 > The later opens emacs in a simple (and ugly) xterm. C'mon. Xterm is the nicest terminal out there ;-) (Actually, after trying several others for a while, I'm now an extremely happy Xterm user. De gustibus...) > The entry in that context menu referes to a .desktop-file > (/usr/share/applications/emacs-term.desktop) with the line >=20 > "Exec=3D/usr/bin/emacs -nw %F" >=20 > xterm is not the default terminal. The default is > "/usr/bin/terminator". I checked that via "update-alternatives --config > x-terminal-emulator". >=20 > When I enter "emacs -nw" in my terminator window the emacs opens in > that terminator window. So there is not xterm involved. That's what Emacs does always. > So it looks like that emacs ignores the systems default terminal. >=20 > What is the background of that behaviour and can I modify it? There must be some option around in *your* desktop environment to control which terminal you start a terminal application with. Either in the .desktop file itself, or some default. As I don't use a DE (I dropped that many years ago) I can't give you more details. Apparently, the freedesktop specification for .desktop entries [1] hasn't a way to specify which terminal to use. So it must be either: (a) your Emacs .desktop entry actually starts an Xterm and therein an Emacs (look into that). This would be something like xterm -e emacs -nw or thereabouts. This would be extremely silly (and somewhat authoritarian), but us computer folks are like that. (b) your DE (you say it's "e.g. Xfce" ;-) somehow thinks you gotta like Xterm. No idea it honours the preferred alternative you set with "update-alternatives" (it should, but hey). HTH [1] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry= -spec-latest.html - tom=C3=A1s --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAmCff2YACgkQBcgs9XrR2kZTkgCeMRmb/MRiUVEh9/HzAeP/Ng0E W0EAn0K7cSBwS0LIlxGRSc4Uc9Z1vfbb =nxvk -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF--