Guake / guake

Drop-down terminal for GNOME
https://guake.github.io
GNU General Public License v2.0
4.37k stars 577 forks source link

$SHELL relative to $PATH prevents guake working #1176

Open japgolly opened 6 years ago

japgolly commented 6 years ago

I'm using Guake 3.0.4 on Arch Linux, you can see all packages installed on my system and their versions here.

I've removed my ~/.gconf/apps/guake directory.

Trying to start guake fails with:

Logging configuration complete
DBus not running, starting it
Wanted GTK theme: ''
Prefer dark theme: False
reload_global: 'F12'
can't bind show-focus key
set_final_window_rect
  height_percents = 50
  width_percents = 100
  halignment = 0
  valignment = 0
  vdisplacement = 0
  hdisplacement = 0
Current monitor geometry
  window_rect.x: 1200
  window_rect.y: 0
  window_rect.height: 1080
  window_rect.width: 1920
is unity: False
Correcteed monitor size:
  total_width: 1920
  total_height: 1080
RESIZING MAIN WINDOW TO THE FOLLOWING VALUES:
  window_rect.x: 1200
  window_rect.y: 0
  window_rect.height: 540
  window_rect.width: 1920
Updated window position: (root_x=1200, root_y=0)
set_final_window_rect
  height_percents = 50
  width_percents = 100
  halignment = 0
  valignment = 0
  vdisplacement = 0
  hdisplacement = 0
Current monitor geometry
  window_rect.x: 1200
  window_rect.y: 0
  window_rect.height: 1080
  window_rect.width: 1920
is unity: False
Correcteed monitor size:
  total_width: 1920
  total_height: 1080
RESIZING MAIN WINDOW TO THE FOLLOWING VALUES:
  window_rect.x: 1200
  window_rect.y: 0
  window_rect.height: 540
  window_rect.width: 1920
Updated window position: (root_x=1200, root_y=0)
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3.6/site-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.guake3.RemoteControl': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/guake/main.py", line 241, in main
    remote_object = bus.get_object(DBUS_NAME, DBUS_PATH)
  File "/usr/lib/python3.6/site-packages/dbus/bus.py", line 241, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python3.6/site-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3.6/site-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3.6/site-packages/dbus/bus.py", line 278, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python3.6/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.guake3.RemoteControl was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3.6/site-packages/guake/main.py", line 356, in exec_main
    if not main():
  File "/usr/lib/python3.6/site-packages/guake/main.py", line 256, in main
    instance = Guake()
  File "/usr/lib/python3.6/site-packages/guake/guake_app.py", line 383, in __init__
    self.add_tab()
  File "/usr/lib/python3.6/site-packages/guake/guake_app.py", line 1751, in add_tab
    pid = self.spawn_sync_pid(directory, box.terminal)
  File "/usr/lib/python3.6/site-packages/guake/guake_app.py", line 1678, in spawn_sync_pid
    Vte.PtyFlags.DEFAULT, wd, argv, [], GLib.SpawnFlags.DO_NOT_REAP_CHILD, None, None, None
GLib.Error: g-exec-error-quark: Failed to execute child process “zsh” (No such file or directory) (8)
gsemet commented 6 years ago

look like you don't have zsh. You may need to reset the setting using dconf:

$ dconf reset /apps/guake
japgolly commented 6 years ago

zsh is my main shell. Also I've tried that reset command but it had no effect unfortunately :(

gsemet commented 6 years ago

dconf is different from gconf. It's been long time since ~/.gconf/apps/guake is no more used

egmontkob commented 6 years ago

dconf reset /apps/guake

That's a no-op for me. To reset all the Guake settings, I need to specify both -f and a trailing slash on my system:

dconf reset -f /apps/guake/
japgolly commented 6 years ago

Hi I just tried both:

dconf reset /apps/guake
dconf reset -f /apps/guake/

I still have the same problem.

Also to confirm zsh:

golly@golly-desktop: ~ 
> which zsh
/usr/bin/zsh
golly@golly-desktop: ~ 
> zsh
golly@golly-desktop: ~ 
> 

Any other ideas to help diagnose this?

gsemet commented 6 years ago

sadly no idea. The issue seems to be related to zsh somehow. It is the latest error message that count:

GLib.Error: g-exec-error-quark: Failed to execute child process “zsh” (No such file or directory) (8)

Others are byproducts of this exception.

japgolly commented 6 years ago

Thanks for the pointer. I found the problem :smile:

> echo $SHELL
zsh
> which zsh
/usr/bin/zsh
> guake
...
GLib.Error: g-exec-error-quark: Failed to execute child process “zsh” (No such file or directory) (8)

where as this works:

SHELL=$(which zsh) guake

I think guake should look for $SHELL on the $PATH

gsemet commented 6 years ago

thanks for this analysis, i'll plan trying to fix in for next release

egmontkob commented 6 years ago

I think this deserves a bit more further investigation. I don't recall ever seeing $SHELL containing a relative path. Is this "valid", is this a common practice? Does it work in other apps that spawn a shell, including other terminal emulators? Is Guake the only exception where this is broken? What goes on under the hood, how does technically Guake launch the child, and how do others? ...

japgolly commented 6 years ago

@egmontkob has a good point. I googled around and wasn't able to find a definitive answer. I did however see many examples using an absolute path and none using a non-absolute one which suggests that the fault is in my environment. If you're able to find a more definitive I'd like to know too :)

gsemet commented 6 years ago

I guess this is because the PATH is not set when executing the shell. Shouldn’t be hard to propagate this env var to exec