Bug 472564

Summary: Dolphin view glitches when oh-my-zsh used in konsole panel
Product: [Applications] dolphin Reporter: Marie Kalouguine <marie.kalouguine>
Component: view-engine: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: katze_942, kfm-devel
Priority: NOR    
Version: 21.12.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Video of the bug
Video with a bare oh-my-zsh (no plugins)

Description Marie Kalouguine 2023-07-24 07:52:32 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Install oh-my-zsh with the powerlevel10k plugin
2. Launch Dolphin
3. Launch `source ~/.zshrc` in the terminal panel (it's not sources automatically because of an old bug)
4. Switch to another location

OBSERVED RESULT
When switching to another location, there is a very brief instant when you see the new location, then the old one, and then the new one again. It makes for very un-smooth transitions when opening a folder for example.

EXPECTED RESULT
Immediately switch to the new view, without going back and forth.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.19.0-46-generic (64-bit)
Graphics Platform: X11
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 15,3 GiB of RAM
Graphics Processor: Mesa Intel® Graphics

ADDITIONAL INFORMATION
The problem does not occur if I run zsh without sourcing my oh-my-zsh plugin (it's ugly though, so it's not a solution).
Also, I did not have this glitch in the past (at least when I was running kubuntu 20.04, don't remember version of dolphin), so it is possibly something new in the dolphin navigation that broke it.

I'm also not sure whether the powerlevel10k plugin is necessary to reproduce the bug, it's just what I have installed on my computer.
Comment 1 Marie Kalouguine 2023-08-18 07:34:09 UTC
After some more testing, turns out from time to time the viewer straight-up refuses to switch to a new location, blocking me in the current folder until I close the konsole panel. Can't figure out when it's happening though, it seems very random.
This bug is making navigation really hard, does anyone have the same problem?
Comment 2 Жора Змейкин 2023-09-04 16:21:11 UTC
(In reply to Marie Kalouguine from comment #1)
> After some more testing, turns out from time to time the viewer straight-up
> refuses to switch to a new location, blocking me in the current folder until
> I close the konsole panel. Can't figure out when it's happening though, it
> seems very random.
> This bug is making navigation really hard, does anyone have the same problem?

Hi, the problem with navigation is already related to another bug, here:
https://bugs.kde.org/show_bug.cgi?id=470031
Comment 3 Marie Kalouguine 2023-09-06 07:29:59 UTC
I'm not sure whether it's the same bug, since my navigation problems are occurring even in $HOME, which definitely doesn't have a long folder name, nor a long path. But they're certainly related, considering the problem only occurs when using oh-my-zsh in dolphin.
Comment 4 Жора Змейкин 2023-09-06 08:30:46 UTC
(In reply to Marie Kalouguine from comment #3)
> I'm not sure whether it's the same bug, since my navigation problems are
> occurring even in $HOME, which definitely doesn't have a long folder name,
> nor a long path. But they're certainly related, considering the problem only
> occurs when using oh-my-zsh in dolphin.

Can you please attach a screenshot of what kind of error Dolphin gives? The bug that I threw to you in general is mostly related not to the length of the folder, but to the delay of zsh due to plugins.
Comment 5 Marie Kalouguine 2023-09-06 08:52:22 UTC
Created attachment 161438 [details]
Video of the bug
Comment 6 Marie Kalouguine 2023-09-06 09:10:44 UTC
As you can see in the video, the command `cd [path]` is called twice, and between them the oh-my-zsh prompt contains the old path. This seems to correspond to the back-and-forth glitch seen in the UI.
The question is : why is the prompt late at switching locations, and why does it influence the actual location in dolphin?
Comment 7 Жора Змейкин 2023-09-06 09:15:38 UTC
(In reply to Marie Kalouguine from comment #6)
> As you can see in the video, the command `cd [path]` is called twice, and
> between them the oh-my-zsh prompt contains the old path. This seems to
> correspond to the back-and-forth glitch seen in the UI.
> The question is : why is the prompt late at switching locations, and why
> does it influence the actual location in dolphin?

Hmm, really. Very strange, in theory there should not be such a thing. Do you use any oh-my-zsh plugins? And also, will you be able to shoot a video where Dolphin does not allow you to go to another folder? I have similar problems and I want to make sure that we are talking about the same bug
Comment 8 Marie Kalouguine 2023-09-06 09:46:18 UTC
(In reply to Zhora Zmeikin from comment #7)
> Hmm, really. Very strange, in theory there should not be such a thing. Do
> you use any oh-my-zsh plugins? And also, will you be able to shoot a video
> where Dolphin does not allow you to go to another folder? I have similar
> problems and I want to make sure that we are talking about the same bug

Unfortunately I haven't found a way to reliably reproduce the "not switching at all" problem, it's happened a few times and seemed random. In any case, it doesn't seem to be the exact same as yours, because I don't get an error message, it just does the same back-and-forth movement but without the "forth" part.

I am using the powerlevel10k theme, as well as three plugins:
    - zsh-syntax-highlighting
    - zsh-autosuggestions
   - zsh-history-substring-search

Disabling all of this doesn't fix the issue. However, since dolphin has another bug that forces the user to manually source ~/.zshrc (it's not sourced automatically), when I open dolphin I only have a bare zsh (without oh-my-zsh), and the bug is absent.
Just to be sure, I created a .zshrc with almost nothing, just a bare oh-my-zsh, and the bug is still the same.
Comment 9 Marie Kalouguine 2023-09-06 09:50:35 UTC
Created attachment 161441 [details]
Video with a bare oh-my-zsh (no plugins)

Here you can see that there's still a double call to `cd [path]`, and the prompt is late in the switching.
You can't really see the glitching here, but that's because without any plugins, zsh gets too fast for the ui to follow.
Comment 10 Жора Змейкин 2023-09-06 09:57:14 UTC
(In reply to Marie Kalouguine from comment #9)
> Created attachment 161441 [details]
> Video with a bare oh-my-zsh (no plugins)
> 
> Here you can see that there's still a double call to `cd [path]`, and the
> prompt is late in the switching.
> You can't really see the glitching here, but that's because without any
> plugins, zsh gets too fast for the ui to follow.

You are using Arch Linux, please try to update Dolphin to the latest version or use the git version (AUR has it). I check this problem with myself and I don't have it. Also try disabling the powerlevel10k theme.
Comment 11 Marie Kalouguine 2023-09-06 10:42:56 UTC
(In reply to Zhora Zmeikin from comment #10)
> You are using Arch Linux, please try to update Dolphin to the latest version
> or use the git version (AUR has it). I check this problem with myself and I
> don't have it. Also try disabling the powerlevel10k theme.

I am not using Arch Linux here, this is Kubuntu 22.04 LTS, and as you can see I disabled everything, including powerlevel10k, and the bug is still here as soon as I include oh-my-zsh. I keep oh-my-zsh completely updated by the way.
I do have another computer running Arch Linux, and yes I don't have the bug on this one. But I can't just go and install the latest dolphin version on my Kubuntu OS, it might break things.
Comment 12 Жора Змейкин 2023-09-06 11:26:39 UTC
(In reply to Marie Kalouguine from comment #11)
> (In reply to Zhora Zmeikin from comment #10)
> > You are using Arch Linux, please try to update Dolphin to the latest version
> > or use the git version (AUR has it). I check this problem with myself and I
> > don't have it. Also try disabling the powerlevel10k theme.
> 
> I am not using Arch Linux here, this is Kubuntu 22.04 LTS, and as you can
> see I disabled everything, including powerlevel10k, and the bug is still
> here as soon as I include oh-my-zsh. I keep oh-my-zsh completely updated by
> the way.
> I do have another computer running Arch Linux, and yes I don't have the bug
> on this one. But I can't just go and install the latest dolphin version on
> my Kubuntu OS, it might break things.

So, I installed Dolphin 21.12.3. Yes, indeed, there is such a problem there. However, in the latest Dolphin versions this problem has already been solved, there is nothing more the KDE developers can do about your problem. In this case the problem is already Kubuntu OS, so I think it's fair to close this report.

I can recommend you to create a new profile with bash and set it as default for Dolphin:
1. Right click on the console.
2. Click create new profile (or switch to Built-in and then create a new profile)
3. In the new profile, check the box to have Dolphin use it by default every time it starts.
4. Change the command to /usr/bin/bash.
Comment 13 Marie Kalouguine 2023-09-06 12:02:22 UTC
(In reply to Zhora Zmeikin from comment #12)
> So, I installed Dolphin 21.12.3. Yes, indeed, there is such a problem there.
> However, in the latest Dolphin versions this problem has already been
> solved, there is nothing more the KDE developers can do about your problem.
> In this case the problem is already Kubuntu OS, so I think it's fair to
> close this report.
> 
> I can recommend you to create a new profile with bash and set it as default
> for Dolphin:
> 1. Right click on the console.
> 2. Click create new profile (or switch to Built-in and then create a new
> profile)
> 3. In the new profile, check the box to have Dolphin use it by default every
> time it starts.
> 4. Change the command to /usr/bin/bash.

I just hoped the fix could be patched on Kubuntu 22.04, since it's an LTS until 2025.
Till then I guess I'll try compiling dolphin from source, hoping it will work normally.
Comment 14 Жора Змейкин 2023-09-06 12:11:31 UTC
(In reply to Marie Kalouguine from comment #13)
> (In reply to Zhora Zmeikin from comment #12)
> > So, I installed Dolphin 21.12.3. Yes, indeed, there is such a problem there.
> > However, in the latest Dolphin versions this problem has already been
> > solved, there is nothing more the KDE developers can do about your problem.
> > In this case the problem is already Kubuntu OS, so I think it's fair to
> > close this report.
> > 
> > I can recommend you to create a new profile with bash and set it as default
> > for Dolphin:
> > 1. Right click on the console.
> > 2. Click create new profile (or switch to Built-in and then create a new
> > profile)
> > 3. In the new profile, check the box to have Dolphin use it by default every
> > time it starts.
> > 4. Change the command to /usr/bin/bash.
> 
> I just hoped the fix could be patched on Kubuntu 22.04, since it's an LTS
> until 2025.
> Till then I guess I'll try compiling dolphin from source, hoping it will
> work normally.

I'm not a KDE developer, so I could be wrong, but as far as I know, KDE only distributes LTS versions to the Plasma shell. There is no support for LTS programs, so they don't get patches in older versions. I'll mark the report as resolved, the bug has been fixed in newer versions of Dolphin.