cd command not found (using xterm's -e option)

Bug #1392624 reported by GenghisKhan
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Sakura
Invalid
Medium
Unassigned

Bug Description

Sakura seems not to be fully compatible with XTerm.

$ sakura -e 'cd $HOME/config/.privoxy/;privoxy --no-daemon config'

$ xterm -e 'cd $HOME/config/.privoxy/;privoxy --no-daemon config'

Tags: xterm
David Gómez (dabisu)
Changed in sakura:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Tominov Sergey (ikenfin) wrote :

I think it because `g_find_program_in_path` (http://bazaar.launchpad.net/~dabisu/sakura/sakura/view/head:/src/sakura.c#L2786) used to validate commands.

`cd` is not actually a program, but a shell builtin command.

So, to fix this bug, need some code, to check this cases, or remove validation completely.

Revision history for this message
Andreas Rönnquist (gusnan) wrote :

Debian policy is being changed to require the -e option to work like in xterm:

Support the command-line option -e command, which creates a new terminal window [6] and runs the specified command. <command> may be multiple arguments, which form the argument list to the executed program. In other words, the behavior is as though the arguments were passed directly to execvp, bypassing the shell. (xterm’s behavior of falling back on using the shell if -e had a single argument and exec failed is permissible but not required.)

see https://www.debian.org/doc/debian-policy/#packages-providing-a-terminal-emulator

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

As Sergey says, yes, g_find_program_in_path doesn't detect builtin commands. But even if sakura removes this validation, the command suggested in the bug description won't work because sakura doesn't support _direct_ execution of multiple commands. But it's possible to do it just executing one command (the shell) with multiple commands after that. As an example using the bug description:

sakura -e "sh -c 'cd $HOME/config/.privoxy/;privoxy --no-daemon config'"

I'll close bug but please comment if you have any other suggestions.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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