nautilus-open-terminal doesn't work with sakura

Bug #559599 reported by David Gómez on 2010-04-09
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sakura
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) on 2010-04-09
Changed in sakura:
status: New → Confirmed
importance: Undecided → Low
description: updated
description: updated
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 ;)

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

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.

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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions