Please make the "-e" option compatible with xterm

Bug #540672 reported by yuanyelele
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sakura
Status tracked in Trunk
Trunk
Fix Released
Low
Unassigned

Bug Description

In xterm, the -e option works like:
    xterm -e vim myfile
and it has to be the last argument. However, in sakura, it works like:
    sakura -e "vim myfile"

There are many scripts rely on the behavior of -e option. So please consider make it compatible with xterm.

Related branches

Revision history for this message
yuanyelele (yuanyelele) wrote :

like in this one (from "awesome window manager" rc.lua):

local editor = (env.editor or "xterm -e " .. (os.getenv("EDITOR") or "vim")) .. " "
local myawesomemenu = {
 { "Edit config", editor .. awful.util.getdir("config") .. "/rc.lua"
 },
}

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

sakura uses GOption to parse the command line. You need to use double quotes to have several values for one option. This allows to use -e option in any place of the command line (when you don't use doble quotes in xterm you only can use -e at the end of the command line). I'm fine with the current behaviour, but i'll leave the bug open in case anyone thinks of a better solution to this.

Changed in sakura:
importance: Undecided → Low
status: New → Confirmed
Calvin M (crazycal00)
Changed in sakura:
assignee: nobody → Calvin M (crazycal00)
Revision history for this message
Calvin M (crazycal00) wrote :

I have a fix for it, you can just add another line in the entries[] array.

i'll upload the patch here.

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

Could you generate the patch again? This one is not ok. The other one you sent me for the focus problem was ok, but that problem is already fixed in trunk. This merge request (bzr send) you created has no patch. If you have problems with it just send the diff (diff -u oldfile newfile) with the changes. Thanks

Revision history for this message
Calvin M (crazycal00) wrote :

Here we go, a correct patch (hopefully :P)

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

Now it's ok :). But it's only the tab label fix, nothing about xterm :). Thanks

Revision history for this message
Kyle Brady (kyleb) wrote :

I put up a branch that solves this. However, I had to change the arguments around. The old -e is -x in my branch and, the new -e works like xterm (only at end of line, everything afterwards turned into the command). Not too sure how launchpad works and I have to go run, but just let me know if you need me to change the code / do something on the site.

Revision history for this message
Calvin M (crazycal00) wrote : Re: [Bug 540672] Re: Please make the "-e" option compatible with xterm

wouldn't it be best to just have both available? ( in case anyones scripted
for sakura? )

On 19 October 2010 12:43, Kyle Brady <email address hidden> wrote:

> I put up a branch that solves this. However, I had to change the
> arguments around. The old -e is -x in my branch and, the new -e works
> like xterm (only at end of line, everything afterwards turned into the
> command). Not too sure how launchpad works and I have to go run, but
> just let me know if you need me to change the code / do something on the
> site.
>
> --
> Please make the "-e" option compatible with xterm
> https://bugs.launchpad.net/bugs/540672
> You received this bug notification because you are a bug assignee.
>
> Status in sakura: Confirmed
>
> Bug description:
> In xterm, the -e option works like:
> xterm -e vim myfile
> and it has to be the last argument. However, in sakura, it works like:
> sakura -e "vim myfile"
>
> There are many scripts rely on the behavior of -e option. So please
> consider make it compatible with xterm.
>
>
>

Revision history for this message
Kyle Brady (kyleb) wrote :

Yeah, having both modes available for -e would be optimal. I could do it pretty easily (checking if the argument after -e has a space should be ok), but the result would not be 100% foolproof, so I erred on the side of caution.

Calvin M (crazycal00)
Changed in sakura:
assignee: Calvin M (crazycal00) → nobody
Revision history for this message
David Gómez (dabisu) wrote :

Wow, thanks! This really needed to get fixed ;). Patch seems ok to me so i going to merge it. I'm with you on the caution side. I've updated the requirements because vte_terminal_fork_command_full is only available from vte 0.26. There are still a couple of calls to deprecated vte_terminal_fork_command that need to be changed, but that's not related to this bug ;)

There was another bug related to this: https://bugs.launchpad.net/sakura/+bug/559599, but still seems to not be working. If you got the time to check it before me, just let me know.

David Gómez (dabisu)
Changed in sakura:
status: Confirmed → Fix Committed
David Gómez (dabisu)
Changed in sakura:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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