elementary / elementary/terminal

No way to run a shellscript in terminal from the GUI

Open
#640 27 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
428
Forks
104
Avg merge
1d 54m
Merged PRs (30d)
2

Description

## Problem
As far as I can tell there is no way in ElementaryOS to create a shellscript that is executable in a terminal by the user clicking or doubleclicking on it.

I have tried making a shellscript executable via POSIX file permissions but double clicking it does not make it run.
There is an option to right click and then click "Run", but this does not seem to run the script in a terminal. Nor does it run the script in the folder in which the script is located.

## Proposal
I would expect a way to run a shellscript (or other program) from the GUI with the script running in the folder where it is located.

I see several possible solutions:

1. If make a script that is marked as executable run in a terminal when doubleclicking it. (with CWD set to the folder in which the script resides)

or

2. Provide an option on the right click menu to run the script in a terminal (with CWD set to the folder in which the script resides)

or

3. Associate shell scripts (ending in .sh or similar - and being marked as executable) with Terminal application and then have the user doubleclick them to execute in the current folder. (I believe this is how it works on Mac OS X)

## Prior Art
I think most modern Linux Desktop Environments support this feature.
Here is an example of how this is done in Gnome:
https://www.cyberciti.biz/faq/run-execute-sh-shell-script/

Mac OS X implements the third option above.

Windows famously allows this automatically for all .bat files: You just doubleclick it and it runs in a terminal.

I would like ElementaryOS to obey the execution bit on the file permissions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.