I'm using the Kate editor ver 16.04.2 on live knoppix 7.7.1 on a usb stick.
When I double-click on a normal text file in pcmanfm, Kate opens but it
replaces the spaces in the filename with %20
, and a message says "New", which
I presume means "new file". The contents of the file I double-clicked on do not
appear in Kate, but the text window is empty.
Say the true filename is my notes
, then Kate changes it to my%20notes
.
If I open Kate separately, then opening the file in the following ways DOES work:
- Using File/Open from Kate's menu, and selecting the file from there.
- Clicking and dragging the file from pcmanfm across to the Kate window.
On my main Debian system on the hard drive, Kate opens a double-clicked file
fine. Why does the double-click opening method replace spaces with %20
, and how do I fix it?
Edit:
I did the following tests (on the live knoppix 7.7.1 on usb stick). They may help in identifying what the remedy is for my problem.
Using pcmanfm
(This is the same scenario I've already described in my original question.)
Kate was already the default application that's launched when a text file is
double-clicked. I double-clicked the file my notes
in pcmanfm, but Kate
opened a NEW file called my%20notes
, with nothing in it.
While Kate was still open, I did the following to see what filename was passed to Kate:
$ ps ax | grep kate
4893 tty5 Sl 0:01 kate -b file:///home/knoppix/my%20notes
I changed the default launch application from Kate to KWrite. When I double-clicked my notes
, KWrite opened a NEW file called my%20notes
.
I changed the default launch application to Leafpad. When I double-clicked
my notes
, Leafpad CORRECTLY opened my notes
.
Using nautilus file manager:
I set the default launch application to Kate. When I double-clicked my notes
,
Kate CORRECTLY opened my notes
(ie no %20 used).
Conclusions
It seems to be ONLY pcmanfm (not other file managers, such as nautilus) that
causes %20
to be used in Kate. Also it seems to be KDE launch applications
(Kate and KWrite) in which the %20
problem occurs -- but only via pcmanfm. I
don't think pcmanfm itself is a KDE application.
kate
, if you run the commandps -ax
in a terminal whilekate
is still running? (Close any existing kate windows before double-clicking the file. The recently started processes will be at the end of theps
output). – sourcejedi Jun 04 '18 at 20:26.desktop
file forkate
ororg.kde.kate
, in/usr/share/applications
, and compare theExec=
line with the "field codes" here: https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html – sourcejedi Jun 04 '18 at 20:30ps
output,pcmanfm
is passing a URL tokate
instead of a filename.%20
is a URL-encoded space, and thefile
protocol lets you access local files -- if you went tofile:///home/knoppix/my%20notes
in a browser it would work. Kate is a text editor and doesn't understand URLs. It's likely thatpcmanfm
is passing URLs regardless of application; it happens that Leafpad can handle them and open the file normally. You need to figure out whypcmanfm
is using URLs. How are you setting the launch app? You might try a custom command-line and set it to/usr/bin/kate %f
– Michael Mrozek Jun 06 '18 at 05:29