Bug 468908

Summary: Dolphin can't open folders with special characters (e.g. Arabic characters, space, #, ?) when embedded Terminal is open (F4) with a non bash-compatible shell like nushell or zsh
Product: [Applications] dolphin Reporter: Munzir Taha <munzirtaha>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: critical CC: duha.bugs, hasezoey, kdedev, kfm-devel, moewold
Priority: NOR    
Version: 23.04.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Munzir Taha 2023-04-24 15:12:07 UTC
I can no longer open most of my Arabic folders in Dolphin. There is no issue if the folder name is brief. If the folder name is around 80+ characters, dolphin injects some random trash characters and tries to open them instead, complaining that the folder does not exist.


STEPS TO REPRODUCE
1. Create a folder with name
عربي عربي عربي عربي عربي عربي عربي عربي عربي

2. Double-click it in dolphin
3. Dolphin shows the following error
 
The file or folder /tmp/%D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%B1%D8%A8%D9%8A %D8%B9%D8%A does not exist.


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 6.2.12-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Munzir Taha 2023-06-12 20:05:06 UTC
Fixed. Thanks.
Comment 2 Munzir Taha 2023-06-14 19:09:42 UTC
Unfortunately, it's not fixed, but the number of characters to reproduce the bug is now increased to 90 instead of 80.
Comment 3 Munzir Taha 2023-06-30 17:48:33 UTC
I just found the bug is related to me making nushell a default. It's actually not restricted to Arabic. If I create a folder with a name that ends in space, I get the same issue.

Create a folder named 'F '  with a trailing space. Trying to open it dolphin shows
The file or folder /tmp/F does not exist.
The space is not passed as part of the name. There is no problem using nushell from the terminal to access the folder, so I guess, the bug lies in dolphin integration to shells
Comment 4 hasezoey 2023-07-20 09:20:35 UTC
i think this bug and https://bugs.kde.org/show_bug.cgi?id=469585 are related to the same issue
Comment 5 Munzir Taha 2023-07-21 15:26:32 UTC
(In reply to hasezoey from comment #4)
> i think this bug and https://bugs.kde.org/show_bug.cgi?id=469585 are related
> to the same issue

What's the shell you are using? My bug only happens with nushell, but with bash I couldn't regenerate it.
Comment 6 hasezoey 2023-07-21 15:35:34 UTC
(In reply to Munzir Taha from comment #5)
> (In reply to hasezoey from comment #4)
> > i think this bug and https://bugs.kde.org/show_bug.cgi?id=469585 are related
> > to the same issue
> 
> What's the shell you are using? My bug only happens with nushell, but with
> bash I couldn't regenerate it.

no shell, as my bug report is about "Show Target" and and "Points to" (and clicking on it) to show error "file does not exist" with special characters that are not encoded / decoded correctly (in my case a question mark).
from what i can tell (at least from the original issue description) it sounds a lot like my bug, so i referenced it in case it is similar.

i have also now tried the original issue reproduction steps, and dolphin can create and open the folders just fine, until i have a embedded terminal open (zsh in my case), where:
- if you open the terminal from inside the folder, then dolphin starts to show "The file or folder ...path to arabic folder.. does not exist", but the shell opens just fine at the correct location
- if the shell is opened before going into the folder, dolphin immediately complains that the folder does not exist and zsh says "cd: no such file or directory", but still cd's into that folder correctly

the same conditions apply if i create a folder named "test?" (with a question mark) - ie a name to what my bug is about
Comment 7 hasezoey 2023-07-21 15:43:25 UTC
reproduction video https://www.youtube.com/watch?v=YQEvOPOA2Sg

@Munzir Taha is this the behavior you are also getting / describing?
Comment 8 Munzir Taha 2023-07-21 16:24:35 UTC
(In reply to hasezoey from comment #7)
> reproduction video https://www.youtube.com/watch?v=YQEvOPOA2Sg
> 
> @Munzir Taha is this the behavior you are also getting / describing?

Yes it's my bug, now try to change your shell from zsh to bash, and you shouldn't notice it!
Comment 9 Shinonome Tera tanuki 2024-02-25 22:56:07 UTC
I encountered similar problem.
To put it simply, when I use zsh as Dolphin's built-in terminal SHELL, if I cd a long directory, the path following the cd automatically executed by Dolphin will be truncated. (This sentence is translated from Google.)

My shell is zsh, my filesystem is xfs, and my distro is Arch Linux. The version of my dolphin is 23.08.5-1.

I assume that there is a path limit for dolphin terminal when it execute cd in the terminal.
But the problem only occurs when the shell is zsh.
If I set $SHELL as sh,bash or fish (like `SHELL=/usr/bin/fish dolphin`), dolphin works fine.

Sorry for my poor English.   :D
Comment 10 TraceyC 2024-06-14 02:14:59 UTC
(In reply to Munzir Taha from comment #8)
> Yes it's my bug, now try to change your shell from zsh to bash, and you
> shouldn't notice it!

I can't reproduce the error shown in the YouTube video with Dolphin 24.02.2. I can also create folders that have a trailing space.
Many improvements have been made in Dolphin since the YouTube video.  Can we ask you to test again with the latest version of Dolphin available for your system and let us know the result and version number?

STEPS TO REPRODUCE
Open Dolphin, go to ~/Downloads. I have the terminal pane shown, using the zsh shell.
Create folder ~/Downloads/test, enter the folder
Create New Folder "test?"
Double click to enter that folder
Create new text file t.txt 
In the video, the location bar changes to Downloads/test/test/ - this did not happen for me.
In the video, an error was shown: "The file or folder /home/user/Downloads/test/test does not exist - this did not happen for me. I am able to list the contents of the test? folder in Dolphin.
Comment 11 TraceyC 2024-06-14 02:15:38 UTC
Forgot to set status, waiting for the results of a new test.
Comment 12 Munzir Taha 2024-06-15 09:56:33 UTC
I confirm the bug is solved now