Ticket #141 (reopened defect)

Opened 5 years ago

Last modified 5 years ago

bssh should use default terminal when launched from menu

Reported by: uws Owned by: lennart
Milestone: Component: avahi-ui
Keywords: Cc:

Description

The summary says it all. Right now bssh (when started from the Gnome menu) launches xterm on my machine, while gnome-terminal should be used. Since ssh needs a terminal anyway, it seems better to just open the default one by specifying this in the .desktop file. The fallback mechanism is left intact for people not using the menu to start bssh.

I'll attach a patch.

Attachments

avahi-terminal-for-bssh-ticket-141.patch (428 bytes) - added by uws 5 years ago.
Always open the default terminal when launched from the menu

Change History

Changed 5 years ago by uws

Always open the default terminal when launched from the menu

Changed 5 years ago by lennart

  • status changed from new to closed
  • resolution set to invalid

Are you running some kind of Debian (or derived) distro? If so you probably have misconfigured your x-terminal-emulator alternatives setting.

The relevant code in bssh.c looks like this:

execlp("x-terminal-emulator", "x-terminal-emulator", "-T", n, "-e", "ssh", "-p", p, "-l", u, h, NULL); 
execlp("gnome-terminal", "gnome-terminal", "-t", n, "-x", "ssh", "-p", p, "-l", u, h, NULL);
execlp("xterm", "xterm", "-T", n, "-e", "ssh", "-p", p, "-l", u, h, NULL);

The first execlp() call that succeeds wins. Since gnome-terminal has not been started on your machine this probably means that x-terminal-emulator was not configured correctly. bssh.c tries to follow your personal settings on your machine. It cannot do clairvoyance and determine that x-terminal-emulator was misconfigured. ;-)

Changed 5 years ago by uws

  • status changed from closed to reopened
  • resolution invalid deleted

I disagree ;) I am indeed running Debian on my machine. However, where x-terminal-emulator points to is a system-wide setting. While I happen to be root on the machine I'm working on right now, this is not always the case, e.g. at the university.

Perhaps some kind of "desktop detection" would be needed? E.g. check for the GNOME_DESKTOP_SESSION_ID envvar, if found get the preferred terminal emulator from gconf (using gconftool), and finally launch it... of course my patch does exactly this, but it opens a terminal before the host is chosen (which I don't think is a problem).

Changed 5 years ago by lennart

Hmm, what would you say if add support to run xdg-terminal before I try x-terminal-emulator? That reads the config from gconf and starts the right terminal.

(No jokes about project Portland please! ;-))

Changed 5 years ago by lennart

Hmm, unfortunately I had to learn that xdg-terminal is not yet part of an official portland release. Tsss.

Note: See TracTickets for help on using tickets.