Skip to content

Open with custom command send string to exec

I was trying to set up Thunar to open text files with Nano in Tilix, and so I wrote tilix -e nano in the Use a Custom Command text box in Open With. This did not work. Running Thunar from the command line and repeating yielded the error sh: line 0: exec: tilix -e nano: not found, which is the same error that appears when running exec "tilix -e nano", so I suspected that the contents of the text box are erroneously sent to exec within a string. Writing "tilix -e nano" in the text box as a workaround (which I expect runs exec ""tilix -e nano"", negating the erroneous quotes) opens the file correctly. I am using i3 on Arch Linux, if that helps.

To reproduce:

Right click on text file: Open with --> Other Application --> Custom Command and enter e.g.

Paste command: xfce4-terminal -x nano

Using the following command will work fine: "xfce4-terminal -x nano"

Edited by Alexander Schwinn