clicking on executable script opens it in scratch

Bug #1089775 reported by Simon
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Files
Fix Released
Medium
Jeremy Wootten

Bug Description

Steps to reproduce:
1. Create an empty file "test.sh"
2. Paste "#!/bin/bash" in it, save and close it.
3. Set the file to be executable (in right click -> Properties)
4. Double click on the file. It will open in scratch.
5. Close scratch.
6. Double click on the file again.

At step 6, the file will be executed. This should happen on step 4 instead of opening scratch.

Related branches

Revision history for this message
Julián Unrrein (junrrein) wrote :

The expected behavior when there exists a shell script marked as executable that begins with "#!/bin/bash" is to execute it, not to open it in scratch.

When I follow your steps, the script is never executed - it is always opened in Scratch. This is clearly a bug.
When pantheon-files is closed and reopened, the file works as expected (i.e. double clicking on it executes the script).

If I interchange steps 2 and 3 of your test, the shell script works as it should on the first try (it will be executed).

Revision history for this message
Julián Unrrein (junrrein) wrote :

Consider changing the title of the bug report and/or adding more info since you don't state very clearly where is the bug or what is the expected behavior for you.

Simon (nowis74)
description: updated
summary: - Double clicking on executable script does nothing
+ Double clicking on executable script opens it in scratch
Revision history for this message
Simon (nowis74) wrote : Re: Double clicking on executable script opens it in scratch

I didn't notice that the file was executed since I was expecting the terminal to show up (I am going to make another bug report about that). Anyway, I tough the expected behavior was to open the file in scratch (since that's what Files does the first time), but I guess it makes more sense to execute it. I corrected the bug report. Also, I don't know if this is the intended behavior, but the script is executed from the home directory instead of the folder it's currently in.

Changed in pantheon-files:
status: New → Confirmed
summary: - Double clicking on executable script opens it in scratch
+ clicking on executable script opens it in scratch
Changed in pantheon-files:
importance: Undecided → Medium
assignee: nobody → elementary UX Team (elementary-design)
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Nautilius used to show a prompt that offered to either open the file in editor, run it, or run it in terminal. Even though I dislike dialogs, this is the only solution where I always realize what's happening.
In other designs I've used I had started scripts in background that require input on stdin, so they just hung there eating memory.

Changed in pantheon-files:
status: Confirmed → In Progress
assignee: elementary UX (elementary-design) → Jeremy Wootten (jeremywootten)
Cody Garver (codygarver)
Changed in pantheon-files:
milestone: none → freya-rc1
Cody Garver (codygarver)
Changed in pantheon-files:
status: In Progress → Fix Committed
Cody Garver (codygarver)
Changed in pantheon-files:
milestone: freya-rc1 → 0.2
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.