nautilus-open-terminal doesn't work with sakura

Bug #559599 reported by David Gómez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sakura
Fix Committed
Low
Unassigned

Bug Description

nautilus-open-terminal doesn't work with sakura. sakura doesn't have a way to use a different directory from home at start time.

David Gómez (dabisu)
Changed in sakura:
status: New → Confirmed
importance: Undecided → Low
description: updated
description: updated
Revision history for this message
Blasse (koralik) wrote :

I'm not a coder, but in nautilus-open-terminal documentation there is a statement, that "Currently, imported libeel helpers
  are used to launch the terminal". Don't know if it would be helpful ;)

Revision history for this message
David Gómez (dabisu) wrote :

I've been reading again nautilus-open-terminal source code. It uses the default terminal to execute a 'cd' command and executes _again_ another subshell... *sigh*. It'd be better to use something like the --working-directory command line option in gnome-terminal, but it's not standard so it won't work with other terminal emulators...

Anyway, if you define sakura as you default terminal in your desktop, it'll be launched by nautilus-open-terminal, but the 'cd' command won't work. This is related to Bug #540672. Solving that bug will solve this one. I'll try to fix it ASAP

description: updated
Revision history for this message
David Gómez (dabisu) wrote :

Bug #540672 if fixed but nautilus-open-terminal still doesn't work. Its need to be checked why...

I've created another bug #772307 to add a new command line option for "--working-directory"

Revision history for this message
JIghtuse (jightuse) wrote :

As I understand, nautilus-open-terminal opens terminal like this:
'/usr/bin/x-terminal-emulator' -e /bin/sh -c 'cd '\''/home/user'\'' && exec $SHELL'

Some investigation shows that sakura call g_shell_parse_argv() passing the last argument in qoutes, and after that we have splitted tokens of it in command_argv:
cargv[0] = /bin/bash
cargv[1] = -c
cargv[2] = cd
cargv[3] = /home/user
cargv[4] = &&
cargv[5] = ls
cargv[6] = &&
cargv[7] = exec
cargv[8] = $SHELL
Next it calls vte_terminal_fork_command_full() with this tokens, and they are not executed. Same command works with xterm. gnome-terminal called with a wrapper on perl, which modifies its arguments. Weird way, but it works.
Finally, evilvte terminal not calls g_shell_parse_argv() at all and pass next arguments to vte_terminal_fork_command():
default_argv[0]: /bin/sh
default_argv[1]: -c
default_argv[2]: cd '/home/user' && exec $SHELL

I tried to join last command_argv elements, without success. Probably I don't understand how something works.

Revision history for this message
JIghtuse (jightuse) wrote :

I just read bug #540672. Сalling sakura with quoted argument to -e works!
'/usr/bin/x-terminal-emulator' -e "/bin/sh -c 'cd '\''/home/usert'\'' && exec $SHELL'"

So, I think problem with -e option.

Revision history for this message
David Gómez (dabisu) wrote (last edit ):

Closing this bug. Currently, open terminal works with sakura. For example, Ubuntu desktop "Open terminal" option opens sakura with the right directory. Gnome Files (aka Nautilus) needs some tweaking, as it doesn't support other terminals directly (see https://github.com/Stunkymonkey/nautilus-open-any-terminal).

Other "open terminal" in other desktops, like Xfce, work too.

Changed in sakura:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.