Nemo: "Run in terminal" fails if path contains spaces

Created on 2 Sep 2020  路  11Comments  路  Source: linuxmint/nemo

```

  • Nemo version 3.6.5
  • windowed nemo
  • Distribution - Ubuntu 16.04
  • 64 bit
    ```

Issue
If the path to an executable script contains spaces, "Run in terminal" does not handle spaces and bash tries to execute the path only up to the first space, resulting in a "file not found" error message.

Steps to reproduce

  • Make sure Nemo is configured to ask which action to take for executable files
  • Create bash script inside a folder with spaces in its path, e.g. ~/space name/script.sh
  • Mark script.sh executable
  • Double click script.sh in Nemo and select "Run in terminal"

Expected behaviour

script.sh is run in terminal.

BUG

Most helpful comment

4dlofp

All 11 comments

Current version of Nemo is 4.6.5 ---
However, the problem still stands:-
/home/jeremy/Desktop/temperature based cpu throttler.sh [normally run elsewhere and with some underscores]
When I attempted to run it from nemo window, I'm offered the usual choice of run in terminal, display, etc
If I tell it to run in terminal it outputs

Screenshot from 2020-09-02 16-30-03

However, if I attempt to display the script, it works fine.

It's your bash scripts that are broken not nemo.

Use

/home/jeremy/Desktop/'temperature based cpu throttler.sh'

or

'/home/jeremy/Desktop/temperature based cpu throttler.sh'

or

/home/jeremy/Desktop/temperature\ based\ cpu\ throttler.sh

I never normally put spaces in scripts - but if I do, nemo should handle the issue in the same way as it does for opening the same file in a text editor.

This is not an issue for me since I have no difficult names in any scripts. ;)

4dlofp

Sorry about the old version, my bad.

@Jeremy7701 Thank you for looking into it on the newest version.

@leigh123linux The problem is not a line inside the script (even an empty script file produces the error), the problem is the path that nemo hands to the terminal. This path is generated by nemo, so the user has no way of adding quotes or escaping spaces as you suggest.

I agree with @HifeFish, this is a bug indeed.

@HifeFish @Jeremy7701 what is Terminal set to in Preferred Applications?

I presume its set to gnome-terminal - at least that's what is run from the LMDE4 menu.

preferred

Yeah it is. There looks to be a couple of factors driving this issue and that setting looks to be one on them. Thanks.

@Jeremy7701 @HifeFish can either you try running
gsettings set org.cinnamon.desktop.default-applications.terminal exec-arg -- Thanks.

I made the gsettings change and no error messages are now generated.
(I checked the change had occurred with the GUI dconf).
A bash script (document 1.sh) which simply creates a file in /tmp was successfully 'run in terminal' from nemo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hairybiker picture Hairybiker  路  5Comments

jean-christophe-manciot picture jean-christophe-manciot  路  5Comments

Enkouyami picture Enkouyami  路  7Comments

gothicVI picture gothicVI  路  5Comments

blueray453 picture blueray453  路  5Comments