Bad path passed to script exec'd via .contract context menu item usage

Bug #1412028 reported by blah
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Files
Fix Released
High
Jeremy Wootten

Bug Description

While playing around with .contract files in Luna I ran into what I *think* is a bug in
either Contractor or Files, or perhaps with how they communicate info between each other.

I created a ~/.local/share/contractor .contract file with the following:

[Contractor Entry]
Name=myscript
Icon=pantheon-files
Description=Do something to the selected entry(s)
MimeType=application;audio;chemical;image;inode;message;model;multipart;text;video;x-conference;x-epoc;x-world
Exec=myscript.sh %f
Gettext-Domain=pantheon-files

myscript.sh is in ~/bin, and contains the following lines of interest:

nsm=$(echo -e "\$1:\t\t\t\t$1\n\$PWD:\t\t\t$PWD\n\$OLDPWD:\t\t$OLDPWD\n\$BASH_ARGV:\t$BASH_ARGV")
notify-send "myscript.sh" "$nsm"

When I do the following within Files, $1 shows up as NOT the path I expected it to be:

1) Open Files and browse to a known folder
2) Right click on Pictures and open it in a new tab
3) Tab switch back to the known folder tab
4) Right click somewhere in the folder's empty area and select the myscript menu item
5) What I see in the notify message is the path to the Pictures folder, not the path
   to the known folder

Continuing like this by opening up more folders, the path of the last opened folder is
what always gets passed to the script when changing folders via tab switching.

The path passed to the script is corrected as soon as a different folder is browsed to.

Related branches

Changed in pantheon-files:
importance: Undecided → High
Changed in pantheon-files:
status: New → Confirmed
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

I have also confirmed this bug

Changed in pantheon-files:
assignee: nobody → Jeremy Wootten (jeremywootten)
milestone: none → juno-beta1
Changed in pantheon-files:
status: Confirmed → In Progress
Cody Garver (codygarver)
Changed in pantheon-files:
status: In Progress → Fix Committed
Cody Garver (codygarver)
Changed in pantheon-files:
milestone: juno-beta1 → 0.3.0.5
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.