all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How does Emacs select the "-nw" terminal
@ 2021-05-15  7:33 c.buhtz
  2021-05-15  7:59 ` tomas
  2021-05-15  8:56 ` Yuri Khan
  0 siblings, 2 replies; 5+ messages in thread
From: c.buhtz @ 2021-05-15  7:33 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I am using

GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of
2021-01-31, modified by Debian

in Debian 10 (stable).

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?

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)".

The later opens emacs in a simple (and ugly) xterm.
The entry in that context menu referes to a .desktop-file
(/usr/share/applications/emacs-term.desktop) with the line

	"Exec=/usr/bin/emacs -nw %F"

xterm is not the default terminal. The default is
"/usr/bin/terminator". I checked that via "update-alternatives --config
x-terminal-emulator".

When I enter "emacs -nw" in my terminator window the emacs opens in
that terminator window. So there is not xterm involved.

So it looks like that emacs ignores the systems default terminal.

What is the background of that behaviour and can I modify it?

Thanks in advance



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does Emacs select the "-nw" terminal
  2021-05-15  7:33 How does Emacs select the "-nw" terminal c.buhtz
@ 2021-05-15  7:59 ` tomas
  2021-05-15 19:55   ` Jean Louis
  2021-05-15  8:56 ` Yuri Khan
  1 sibling, 1 reply; 5+ messages in thread
From: tomas @ 2021-05-15  7:59 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 2612 bytes --]

On Sat, May 15, 2021 at 07:33:45AM +0000, c.buhtz@posteo.jp wrote:
> Hello,
> 
> I am using
> 
> GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of
> 2021-01-31, modified by Debian
> 
> in Debian 10 (stable).
> 
> 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)".
> 
> 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
> 
> 	"Exec=/usr/bin/emacs -nw %F"
> 
> xterm is not the default terminal. The default is
> "/usr/bin/terminator". I checked that via "update-alternatives --config
> x-terminal-emulator".
> 
> 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.
> 
> 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ás

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does Emacs select the "-nw" terminal
  2021-05-15  7:33 How does Emacs select the "-nw" terminal c.buhtz
  2021-05-15  7:59 ` tomas
@ 2021-05-15  8:56 ` Yuri Khan
  2021-05-15 21:11   ` c.buhtz
  1 sibling, 1 reply; 5+ messages in thread
From: Yuri Khan @ 2021-05-15  8:56 UTC (permalink / raw)
  To: c.buhtz; +Cc: help-gnu-emacs

On Sat, 15 May 2021 at 14:33, <c.buhtz@posteo.jp> wrote:

> 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)".
>
> The later opens emacs in a simple (and ugly) xterm.
> The entry in that context menu referes to a .desktop-file
> (/usr/share/applications/emacs-term.desktop) with the line
>
>         "Exec=/usr/bin/emacs -nw %F"

> xterm is not the default terminal. The default is
> "/usr/bin/terminator". I checked that via "update-alternatives --config
> x-terminal-emulator.

Xfce has a different notion of “the” default terminal. See
‘xfce4-settings-manager’, Preferred Applications, Utilities tab.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does Emacs select the "-nw" terminal
  2021-05-15  7:59 ` tomas
@ 2021-05-15 19:55   ` Jean Louis
  0 siblings, 0 replies; 5+ messages in thread
From: Jean Louis @ 2021-05-15 19:55 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

* tomas@tuxteam.de <tomas@tuxteam.de> [2021-05-15 11:00]:
> > The later opens emacs in a simple (and ugly) xterm.
> 
> C'mon. Xterm is the nicest terminal out there ;-)

It is definitely fastest. Just set it up how you like it.

Find here my ~/.Xdefaults

! From: https://aduros.com/blog/xterm-its-better-than-you-thought/
! XTerm.vt100.geometry: 110x30+25+26
XTerm.vt100.geometry: 100x29+25+36
XTerm.vt100.locale: false
XTerm.vt100.utf8: true
XTerm.vt100.scrollTtyOutput: false
XTerm.vt100.scrollKey: true
XTerm.vt100.bellIsUrgent: true
XTerm.vt100.metaSendsEscape: true
XTerm.vt100.eightBitInput: true
! Styling
XTerm.vt100.cursorColor:	yellow
XTerm.vt100.background:	black
XTerm.vt100.foreground:	white
XTerm.vt100.faceName: DejaVu Sans Mono
XTerm.vt100.boldMode: false
XTerm.vt100.faceSize: 12
XTerm.vt100.internalBorder: 16
XTerm.borderWidth: 0
! Printing
XTerm.vt100.printerCommand: select-url
! Keybinding
XTerm.vt100.translations: #override \n\
    Ctrl Shift <Key>W: print(noAttrs, noNewLine)
    Ctrl Shift <Key>H: set-altscreen(toggle)



-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How does Emacs select the "-nw" terminal
  2021-05-15  8:56 ` Yuri Khan
@ 2021-05-15 21:11   ` c.buhtz
  0 siblings, 0 replies; 5+ messages in thread
From: c.buhtz @ 2021-05-15 21:11 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks for your answers and suggestions.

Am 15.05.2021 10:56 schrieb Yuri Khan:
> Xfce has a different notion of “the” default terminal. See
> ‘xfce4-settings-manager’, Preferred Applications, Utilities tab.

I checked that. It is set to "debians default", too. When I use the 
"Terminal" entry from the Xfce Programm menu it opens my "terminator" as 
aspected.
There must be another reason.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-15 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-15  7:33 How does Emacs select the "-nw" terminal c.buhtz
2021-05-15  7:59 ` tomas
2021-05-15 19:55   ` Jean Louis
2021-05-15  8:56 ` Yuri Khan
2021-05-15 21:11   ` c.buhtz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.