Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#838 Wrong default execution action is selected

1.2
closed-fixed
libfm (264)
5
2014-10-01
2014-03-04
Sworddragon
No

I'm using PCManFM 1.2.0 and on double clicking a file a subwindow appears which asks what to do. Normally PCManFM tries to focus already the correct action but this doesn't work correctly. For example scripts which are executable and have a valid shbang line are defaulting to "Execute in Temrinal" which can lead the script to fail while it would work on "Execute" (this is especially annoying with quick_exec=1). I think if these both conditions on scripts are true (executable permission and valid shbang line) the default action should be "Execute" too.

Discussion

  • It is not always correct because some scripts might be OK to be executed without terminal while other may require a terminal. And I see no any possible case if any script may fail if executed in terminal, it simply should never happen. Give me example of such script, please, and I check what may cause such weird behavior. Also of course, give me your value for terminal setting in libfm.conf, please. Thank you very much.

     
    • labels: --> libfm
    • assigned_to: Lonely Stranger
     
  • Sworddragon
    Sworddragon
    2014-05-02

    The setting is "terminal=x-terminal-emulator %s" (the problem also happens without %s).

    Example script from my system:

    1
    2
    3
    4
    5
    6
    #!/bin/bash -eu
    
    export WINEDEBUG
    
    WINEDEBUG=-all
    '/wine/drive_c/Program Files (x86)/Warcraft III/Frozen Throne.exe' -opengl &
    

    The script is executable too. Choosing "Execute in Terminal" will open LXTerminal but it will just stay open without printing something. As I said in my opinion it should not be tried to open such a script in the terminal (if a script does really need a terminal it can handle it itself).

     
    Last edit: Sworddragon 2014-05-02
  • No, script cannot "handle it itself", scripts are not supposed to explore user selected terminal then start it then run another script in it, that is in many cases even impossible to do. Therefore it is invalid to never run scripts in terminal, I know some users that run scripts which require terminal. In the case above I believe it's better to create a launcher (desktop entry file) instead of script. I see no solution to satisfy two opposite requirements (allow to run scripts that require terminal, and allow to run scripts without a terminal) in a unified start mode, I'm sorry.

    I just can suggest to create desktop entry for starting a graphic application, and use script to run some complex work in a terminal environment. And you know, creating a desktop entry is very simple task in 1.2.0. Your entry may be done with execution line /bin/bash -euc "WINEDEBUG=-all '/wine/drive_c/Program Files (x86)/Warcraft III/Frozen Throne.exe' -opengl" and you can set some icon and fine name to it you know.

    Well, I'll start a discussion in the mailing list, may be we can find some way to make you happier.

     
  • Since I got no opinions on this and it seems only user who uses that quick_exec option is you, I decided to simply satisfy your request for the case if quick_exec is true. For default choice in the dialog - I would like to not change it ever in the reason of feature freeze and compatibility with all older versions.
    Thank you very much for your contributions into the project.

     
    • status: open --> pending-fixed
     
    • status: pending-fixed --> closed-fixed