! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar can't open files with terminal-editors
Status:
RESOLVED: INVALID

Comments

Description Aleks 2018-11-27 00:55:55 CET
Thunar 1.8.2

I can not open files in thunar with terminal-editors like vim and nano. This worked however on an older version which I used on Linux Mint 19. I tried two approaches:

1. Right-click on a file in thunar and click on 'Open with vim' -> nothing happens
2. Right-click on a file in thunar
    -> Click on 'Open with other Application'
    -> Click on 'Use a custom command'
    -> Type 'xfce4-terminal -e nano' and click on Open
    -> Nothing happens

Both methods worked for me on Linux Mint 19.
Comment 1 alexxcons editbugs 2018-11-27 21:28:31 CET
I tried with thunar 1.6.x and 1.8.x .. does not work on both for me, but actually that was what I expected.

Actually I dont think there is a chance that it works out of the box, since nano and vi need to run in a terminal.
You can add a special .desktop file into your Applications folder(usually /usr/share/applications/ )  which defines how to launch nano/vi and which Terminal Emulator to use. Than thunar should offer it in "start with ...".

Possibly the previous version of linux-mint provided such a file ? For sure it is not a thunar issue.

Another solution would be to get the custom-action right ... actually you almost did it, you just missed some quotes.
I just fixed the related wiki-entry:
https://docs.xfce.org/xfce/thunar/custom-actions#using_nano_text_editor_in_a_terminal
Comment 2 Aleks 2018-11-28 17:07:00 CET
Just as a side-note:

1. 'xfce4-terminal -x nano' works for me on Linux-Mint 19 Xfce Thunar v1.6.15 as a custom command in thunar (note it only works with -x and not -e)

2. 'xfce4-terminal -e 'nano %f'' doesn't work for me as a custom command in thunar.
Comment 3 Aleks 2018-11-28 18:20:22 CET
Also it is weird that when you install vim then thunar shows you the option to open it with vim when you right-click on a file, however it doesn't work. Either the vim-option should show up and work (preferred solution) or the icon simply shouldn't show up. I believe there is a way to get it to work because as I said with cinnamon it worked (the vim-icon and custom command for nano). Couldn't thunar create those desktop-files by itself?
Comment 4 Aleks 2018-11-28 18:24:14 CET
This might be related: https://bugzilla.xfce.org/show_bug.cgi?id=14309 
The same error as described in the link showed up in thunar 1.6.15 when clicking on the vim-option in thunar.
Comment 5 alexxcons editbugs 2018-11-28 22:05:07 CET
Take care for the custom action!
-x and -e seem to do slightly different things .. not sure if this is a bug in xfce4-terminal or some kind of feature:

For me "xfce4-terminal -x nano %f" works fine, but "xfce4-terminal -e nano %f" does not.
On the other hand "xfce4-terminal -e 'nano %f'" works fine, but xfce4-terminal -x 'nano %f'" does not.

Please take a try in the terminal first, use some concrete filename instead of %f and confirm that it works there .. any error ?
Than put it into the custom action, and replace the filename by %f

As well make sure to select "Text Files" in the UCA Appearance conditions!

> Couldn't thunar create those desktop-files by itself?
Each application creates only its own desktop files ... just imagine thunar would have to handle thousands of .desktop files. On top thunar is not the only user of .desktop files.

I just installed vim on my system (debian stretch) and took a try. I directly see vim in the "open with" List.  It opens vim in a xterm for me, no problems at all ( I would prefer xfce4-terminal ... seems like the default on debian is xterm. The  .desktop file only stats "Terminal=true" )

So it seems to be not a thunar problem. I guess either it is a problem of your distro, or of your configuration.
Did you set xfce4-terminal as terminal Emulator in the "Preferred Applications" ?

Possibly your default system terminal-emulator is missing? Maybe "gnome-terminal" or "mate-terminal" ?
Comment 6 Aleks 2018-11-29 10:58:52 CET
Thank you for your help. I close it.

Bug #14910

Reported by:
Aleks
Reported on: 2018-11-27
Last modified on: 2018-11-29

People

Assignee:
Xfce Bug Triage
CC List:
3 users

Version

Attachments

Additional information