KonsolePart's showShellInDir() function caused this issue. But the reason is still unclear. This fix is the same solution Dolphin uses to switch directory.
BUG: 411965
broulik |
Kate | |
Konsole |
KonsolePart's showShellInDir() function caused this issue. But the reason is still unclear. This fix is the same solution Dolphin uses to switch directory.
BUG: 411965
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Kate has moved to GitLab; can you abandon this patch and re-submit it at https://invent.kde.org/kde/kate/merge_requests/?
First: Thanks a lot for tracing that to this call!
For the fix:
I am not sure this is a good idea.
Can't we fix that inside the showShellInDir function? I think we use that at some other place, too.
And other applications have the same problem, why workaround everywhere?
If I know how to fix it in Konsole, I will definitely do it. But I cannot find the cause in KonsolePart. Dolphin took the same solution, instead of call the function, they send cd command. I also pushed it to GitLab/Invent https://invent.kde.org/kde/kate/merge_requests/19/diffs
What happens if e.g. vi or another text editor is open? Do we send the cd... command then to the editor?
I think send terminal input this way is inherently flawed.
No, it won't happen because the cd command is sent immediately after mounting KonsolePart. When switching to new projects, new KonsolePart widgets will be used. Here isn't reuse/reset of KonsolePart.
I track down the issue and the source is this line in konsole:
return window->winId();