Summary: | clicking on a shell script will run it silently, instead of running it in konsole or other terminal emulator. | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | aapgorilla <godutchnow> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 501337, adaptee, adrian, arjunak234, emmanuelpescosta099, kde, konsole-devel |
Priority: | NOR | ||
Version: | 2.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | 70cd19a70e045b6346c8e35d18d6742141ebd0b4 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Ask before executing scripts |
Description
aapgorilla
2010-02-04 23:40:32 UTC
i think that this is a konsole issue, can i commit this patch ? +--- apps/konsole/desktop/konsole.desktop ++++ apps/konsole/desktop/konsole.desktop 2010-01-07 11:20:06.000000000 +0100 +@@ -5,6 +5,7 @@ + X-DocPath=konsole/index.html + Terminal=false + X-KDE-StartupNotify=true ++MimeType=text/x-shellscript; + + Name=Konsole + Name[af]=Konsole @Nicolas: Thanks for the patch! Could you please post your patch to review.kde.org? It is not in the responsibility of Dolphin and I cannot decide whether it should be committed. Thanks! (In reply to comment #1) > i think that this is a konsole issue, can i commit this patch ? > > > +--- apps/konsole/desktop/konsole.desktop > ++++ apps/konsole/desktop/konsole.desktop 2010-01-07 11:20:06.000000000 > +0100 > +@@ -5,6 +5,7 @@ > + X-DocPath=konsole/index.html > + Terminal=false > + X-KDE-StartupNotify=true > ++MimeType=text/x-shellscript; > + > + Name=Konsole > + Name[af]=Konsole Hi neoclust, was this the patch you included in mdv earlier? I think it only works partially, eg running opera from these tarballs in the link below doesnt work in kde but does in gnome/xfce: http://snapshot.opera.com/unix/snapshot-6208/ Done here : http://reviewboard.kde.org/r/2865/ i will look now why the opera one doesn't work the message is : The Opera binary is not located at "usr/lib/opera/opera". Please modify the wrapper script at "/home/neoclust/Bureau/opera-10.50-6208.x86_64.linux/opera". so it tries to start the script but there was something wrong (In reply to comment #5) > the message is : > > The Opera binary is not located at "usr/lib/opera/opera". > Please modify the wrapper script at > "/home/neoclust/Bureau/opera-10.50-6208.x86_64.linux/opera". > > so it tries to start the script but there was something wrong Ah now I remember, the script should be run from the current dir but this patch runs all scripts from $HOME How is this a Konsole bug? Konsole is a terminal emulator, nothing more. This may be a dolphin bug. But certainly not Konsole. Clicking on something displayed in a Konsole session might highlight it, might use your browser (konqueror/firefox/iceweasel/opera/chome) to open a link, might copy something to the clipboard. But clicking on something displayed in a Konsole session should never execute anything. That's what konqueror/dolphin/whatever file-browser you prefer is supposed to do. Very odd. Not a Konsole bug. This is definitely not a bug of konsole. If konsole is invoked but fails to show up and run that script, that is konsole's bug. But if konsole never got invoked by dolphin, it's not konsole's fault. I have update my konsole.desktop as described in comment #1 and set konsole as default terminal emulator in systemsettings. And here is the proof : 1). choose a long-running or never-ending shell script, click it in dolphin. Nothing happens. But if you use ps command, you will find that script is running and its parent is dolphin. In my example, it shows like this : USER PID PPID %CPU %MEM VSZ RSS TTY STAT POL WCHAN START TIME COMMAND whodare 11699 28087 9.2 1.6 226648 51728 ? sl ts poll_s 17:29 0:02 kdeinit4: dolphin [kdeinit] --icon system-file-manager -caption dolphin whodare 11731 11699 0.0 0.0 6640 1312 ? s ts wait 17:29 0:00 /bin/bash /home/whodare/bin/crontab/pull-source-code.sh That implies dolphin never invokes konsole, but invokes the script itself instead . 2). another proof which looks more convincing: a). write a simple wrapper for konsole and save it as ~/bin/konsole (executable, of course), like this : #!/bin/bash echo /usr/bin/konsole --nofork $@ >> ~/konsole.log /usr/bin/konsole --nofork $@ 2). start dolphin by 'path=$HOME/bin:$PATH dolphin', and click some shell script. 3). nothing was written into ~/konsole.log, because ~/bin/konsole was not invoked. So, this should not be a bug of konsole. Assign it to dolphin because it is unlike a issue of konsole. See comment #7 and #8. maybe related with bug #124681 maybe related with bug #241580 *** Bug 179863 has been marked as a duplicate of this bug. *** Resetting assignee to default as per bug #305719 Steps to reproduce: 1. Enter a folder other than $HOME. 2. Create a file in that folder named “test.sh”, with the following content: #!/bin/bash kdialog --msgbox $(pwd) 3. Give that file execution permissions: 3.1. Open the Dolphin terminal (F4). 3.2. Run chmod +x test.sh 3.3. Close the Dolphin terminal (F4). 4. Click the “test.sh” file. Expected results: It should show the current path. It works for me in Dolphin 2.1 (Chakra). Adrián, you miss the main point in this report: when a shell script is started by double clicking in dolphin, konsole should be started to provide the running environment and give user the clear feedback that the script has been started. Without that, there is no easy way to know whether that script has been started, unless you use ps command in another emulator to check for it . In your example, you know the script has been started because that script happens to start a GUI application. That is definitely not the common case. I though the original report was about the script not being executed, which in turns was motivated by the script in question being executed from $HOME when launched from Dolphin. If the issue is just that a console is not opened, shouldn’t it then be in the wishlist? Created attachment 79448 [details]
Ask before executing scripts
I made a simple patch that asks user before attempting to run any script (x-shellscript, x-python, ...) and offers to run it or open in editor.
It can be easily extended to add option "open in terminal", however i am not really sure how to run preferred terminal emulator (other than just explicitly run /usr/bin/konsole with QProcess or KRun::runCommand)
Thanks for the patch, David. It applies rather to bug 172038 than to the present one though (even though both are certainly related). The best way to submit patches is to upload them to https://git.reviewboard.kde.org/ and add the relevant people as reviewers. In this case, these should definitely include Jekyll Wu and David Faure because they did some work concerning the execution of scripts (see https://git.reviewboard.kde.org/r/107086/ and bug 275405 comment 12). If we decide to implement the messaage box, we'll probably need a "Do not ask again"-like checkbox and a corresponding option in the settings. But before you work on that, I'd prefer to have a discussion with Jekyll, David and possibly others on ReviewBoard or the mailing list to decide which approach to take. Now that we have 6fe41269df673215b88b52571b574ed575d81e6f (Get user's permission before executing scripts or desktop files), can't this be closed? (In reply to Arjun AK from comment #19) > Now that we have 6fe41269df673215b88b52571b574ed575d81e6f (Get user's > permission before executing scripts or desktop files), can't this be closed? Yes I think so, thanks! |