Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-03-28 15:30:35

tomeaton17
Member
Registered: 2018-03-28
Posts: 4

exo-open cannot open text files with vim [SOLVED]

I am having a problem with exo-open opening text files with vim.

The command "exo-open file.txt" errors "failed to execute child process 'xterm'". However, "exo-open --launch TerminalEmulator" correctly opens my terminal (xfce4-terminal). I can get vim to open the text file with "exo-open --launch TerminalEmulator /usr/bin/vim file.txt".

Why does exo-open file.txt try to open xterm not xfce4-terminal?

Tom

Last edited by tomeaton17 (2018-03-29 16:19:56)

Offline

#2 2018-03-28 17:13:01

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

Took me a while! Are you on a Debian family distro?

This MATE bug references the corresponding Debian and Ubuntu bugs and also offers some info and possible workaround (didn't try, don't use vim). Not sure if it's fixed or not. Glib development seems particularly arcane.

Offline

#3 2018-03-28 17:14:35

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

Ooops... and welcome to the forum!

Offline

#4 2018-03-29 09:19:51

tomeaton17
Member
Registered: 2018-03-28
Posts: 4

Re: exo-open cannot open text files with vim [SOLVED]

Thank you for the welcome! I am using Arch Linux, probably should have put that in the op.

Offline

#5 2018-03-29 14:09:18

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

Honestly, this goes way over my head... I ended up in some termcap rabbit hole [the shivers], but I also found this recent Arch forum thread that deals with a similar situation (and in the end points to some Glib glitch, again), which concludes:

Trilby wrote:

    That's hardcoded into it?  That's horrible. (edit: yes, I confirmed it is hardcoded in, and yes that is horrible).

xdg-open is not much better. It assumes it is run in a terminal and never even checks if it has to start one. So it probably is best to hardcode your terminal in desktop files and remove Terminal=true.

FWIW, I replicated your situation in my laptop,

exo-open file.txt

(with the text/plain MIME type default app set to vim) opens Vim in xterm, while

exo-open --launch TerminalEmulator vim file.txt

did the right thing and opened in my default terminal.

What's the output of these commands?

printenv | grep TERM
xfce4-terminal -V
cat /usr/share/applications/vim.desktop
pacman -Qi xterm

Offline

#6 2018-03-29 14:24:07

tomeaton17
Member
Registered: 2018-03-28
Posts: 4

Re: exo-open cannot open text files with vim [SOLVED]

Thanks for the reply.
Here is the output of the commands:

TERM=xterm-256color

terminal version:

xfce4-terminal 0.8.7.3 (Xfce 4.12)

Copyright (c) 2003-2018
	The Xfce development team. All rights reserved.

Written by Benedikt Meurer <benny@xfce.org>,
Nick Schermer <nick@xfce.org>
and Igor Zakharov <f2404@yandex.ru>.

Please report bugs to <http://bugzilla.xfce.org/>.

vim.desktop:

[Desktop Entry]
Name=Vim
GenericName=Text Editor
GenericName[de]=Texteditor
Comment=Edit text files
Comment[af]=Redigeer tekslêers
Comment[am]=የጽሑፍ ፋይሎች ያስተካክሉ
Comment[ar]=حرّر ملفات نصية
Comment[az]=Mətn fayllarını redaktə edin
Comment[be]=Рэдагаваньне тэкставых файлаў
Comment[bg]=Редактиране на текстови файлове
Comment[bn]=টেক্স্ট ফাইল এডিট করুন
Comment[bs]=Izmijeni tekstualne datoteke
Comment[ca]=Edita fitxers de text
Comment[cs]=Úprava textových souborů
Comment[cy]=Golygu ffeiliau testun
Comment[da]=Redigér tekstfiler
Comment[de]=Textdateien bearbeiten
Comment[el]=Επεξεργασία αρχείων κειμένου
Comment[en_CA]=Edit text files
Comment[en_GB]=Edit text files
Comment[es]=Edita archivos de texto
Comment[et]=Redigeeri tekstifaile
Comment[eu]=Editatu testu-fitxategiak
Comment[fa]=ویرایش پروندههای متنی
Comment[fi]=Muokkaa tekstitiedostoja
Comment[fr]=Édite des fichiers texte
Comment[ga]=Eagar comhad Téacs
Comment[gu]=લખાણ ફાઇલોમાં ફેરફાર કરો
Comment[he]=ערוך קבצי טקסט
Comment[hi]=पाठ फ़ाइलें संपादित करें
Comment[hr]=Uređivanje tekstualne datoteke
Comment[hu]=Szövegfájlok szerkesztése
Comment[id]=Edit file teks
Comment[it]=Modifica file di testo
Comment[ja]=テキストファイルを編集します
Comment[kn]=ಪಠ್ಯ ಕಡತಗಳನ್ನು ಸಂಪಾದಿಸು
Comment[ko]=텍스트 파일을 편집합니다
Comment[lt]=Redaguoti tekstines bylas
Comment[lv]=Rediģēt teksta failus
Comment[mk]=Уреди текстуални фајлови
Comment[ml]=വാചക രചനകള് തിരുത്തുക
Comment[mn]=Текст файл боловсруулах
Comment[mr]=गद्य फाइल संपादित करा
Comment[ms]=Edit fail teks
Comment[nb]=Rediger tekstfiler
Comment[ne]=पाठ फाइललाई संशोधन गर्नुहोस्
Comment[nl]=Tekstbestanden bewerken
Comment[nn]=Rediger tekstfiler
Comment[no]=Rediger tekstfiler
Comment[or]=ପାଠ୍ଯ ଫାଇଲଗୁଡ଼ିକୁ ସମ୍ପାଦନ କରନ୍ତୁ
Comment[pa]=ਪਾਠ ਫਾਇਲਾਂ ਸੰਪਾਦਨ
Comment[pl]=Edytor plików tekstowych
Comment[pt]=Editar ficheiros de texto
Comment[pt_BR]=Edite arquivos de texto
Comment[ro]=Editare fişiere text
Comment[ru]=Редактор текстовых файлов
Comment[sk]=Úprava textových súborov
Comment[sl]=Urejanje datotek z besedili
Comment[sq]=Përpuno files teksti
Comment[sr]=Измени текстуалне датотеке
Comment[sr@Latn]=Izmeni tekstualne datoteke
Comment[sv]=Redigera textfiler
Comment[ta]=உரை கோப்புகளை தொகுக்கவும்
Comment[th]=แก้ไขแฟ้มข้อความ
Comment[tk]=Metin faýllary editle
Comment[tr]=Metin dosyalarını düzenle
Comment[uk]=Редактор текстових файлів
Comment[vi]=Soạn thảo tập tin văn bản
Comment[wa]=Asspougnî des fitchîs tecses
Comment[zh_CN]=编辑文本文件
Comment[zh_TW]=編輯文字檔
TryExec=vim
Exec=vim %F
Terminal=true
Type=Application
Keywords=Text;editor;
Icon=gvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

pacman -Qi xterm

error: package 'xterm' was not found

Thanks for the help so far smile

Offline

#7 2018-03-29 15:27:41

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: exo-open cannot open text files with vim [SOLVED]

alcornoqui wrote:

Honestly, this goes way over my head.

Mine, too, lol. Says on http://vimdoc.sourceforge.net/htmldoc/starting.html that simply typing

vim filename

works.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#8 2018-03-29 15:35:44

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

So... you can either install Xterm (and use Vim in Xterm), or modify the vim.desktop file to use the Xfce terminal?

To modify the desktop file, you may have Menulibre or Alacarte already installed. If so, right click the Whisker Menu button and choose "Edit Applications", filter for "vim" and change the command to:

exo-open --launch TerminalEmulator vim %F

and toggle off the "Execute in terminal" option (this is important), then save your changes (also important!) and try... and then tell us smile

Offline

#9 2018-03-29 15:41:27

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

@MDM

It's not the same, that would work from Xfce terminal and open Vim in that same terminal window, but if issued, for example, from the Alt+F2 GUI launcher or a script or whatever it wouldn't work, whereas "exo-open --launch TerminalEmulator vim %F" works anywhere (one hopes!).

lol i don't even use vim

Offline

#10 2018-03-29 16:00:22

tomeaton17
Member
Registered: 2018-03-28
Posts: 4

Re: exo-open cannot open text files with vim [SOLVED]

alcornoqui wrote:

So... you can either install Xterm (and use Vim in Xterm), or modify the vim.desktop file to use the Xfce terminal?

To modify the desktop file, you may have Menulibre or Alacarte already installed. If so, right click the Whisker Menu button and choose "Edit Applications", filter for "vim" and change the command to:

exo-open --launch TerminalEmulator vim %F

and toggle off the "Execute in terminal" option (this is important), then save your changes (also important!) and try... and then tell us smile

Can confirm this works sort of, I had to specify the path of vim like so

exo-open --launch TerminalEmulator /usr/bin/vim &F

and then it works!

Thanks for the help alcornoqui.

Offline

#11 2018-03-29 16:18:18

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: exo-open cannot open text files with vim [SOLVED]

Great! You can prepend [SOLVED] to the subject line, if you will.

See you around.

Offline

#12 2018-03-29 16:44:33

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: exo-open cannot open text files with vim [SOLVED]

alcornoqui wrote:

@MDM

It's not the same, that would work from Xfce terminal and open Vim in that same terminal window, but if issued, for example, from the Alt+F2 GUI launcher or a script or whatever it wouldn't work

Apologies. I naively believed a Wikipedia article again.

Vim is designed for use both from a command-line interface and as a standalone application in a graphical user interface.

But you are correct. I even (temporarily) installed the thing to verify when I saw your statement that you don't even use it, thinking you might have been guessing.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

Board footer

Powered by FluxBB