Ticket #141 (reopened defect)

Opened 2 years ago

Last modified 1 year ago

bssh should use default terminal when launched from menu

Reported by: uws Assigned to: lennart
Priority: major Milestone:
Component: avahi-ui Version:
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 on 05/18/07 11:07:31.
Always open the default terminal when launched from the menu

Change History

05/18/07 11:07:31 changed by uws

  • attachment avahi-terminal-for-bssh-ticket-141.patch added.

Always open the default terminal when launched from the menu

05/21/07 19:24:24 changed 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. ;-)

05/21/07 20:37:44 changed by uws

  • status changed from closed to reopened.
  • resolution 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).

05/25/07 00:24:46 changed 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! ;-))

05/25/07 02:24:51 changed by lennart

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