Summary: | konsole starts with Root Shell as default | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Jiri Slaby <jirislaby> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | a.samirh78, axel.braun, nate |
Priority: | NOR | ||
Version: | 21.12.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/utilities/konsole/commit/eb44240235fa61e662e9a521f72e8be9213bb536 | Version Fixed In: | 21.12.1 |
Sentry Crash Report: |
Description
Jiri Slaby
2022-01-03 10:30:58 UTC
This opens the profile just fine. $ konsole --profile Shell It's just [Desktop Entry].DefaultProfile cannot be loaded somehow and Root Shell is used instead (and also set as the default). The same profile is mis-loaded in dolphin by F4. Bisected to: commit 50041fd02ee42cf2cd484f91869896419e09ef83 (HEAD) Author: Ahmad Samir <a.samirh78@gmail.com> Date: Wed Aug 11 13:38:12 2021 +0200 Simplify ProfileManager code Now all the profiles are loaded in the constructor; I didn't see any noticeable difference in loading times. Also all the profiles are loaded anyway because ProfileList calls ProfileManager::allProfiles() to populate the profiles menu ...etc. I think I see what's causing this, I'll create an MR shortly. (In reply to Ahmad Samir from comment #3) > I think I see what's causing this, I'll create an MR shortly. It's likely the endsWith... (In reply to Jiri Slaby from comment #4) > (In reply to Ahmad Samir from comment #3) > > I think I see what's causing this, I'll create an MR shortly. > > It's likely the endsWith... And Root Shell.profile vs Shell.profile I believe you'll come up with sth like: --- a/src/profile/ProfileManager.cpp +++ b/src/profile/ProfileManager.cpp @@ -211,7 +211,7 @@ void ProfileManager::loadAllProfiles(const QString &defaultProfileFileName) const QStringList &paths = availableProfilePaths(); for (const QString &path : paths) { Profile::Ptr profile = loadProfile(path); - if (profile && !defaultProfileFileName.isEmpty() && path.endsWith(defaultProfileFileName)) { + if (profile && !defaultProfileFileName.isEmpty() && QFileInfo(path).fileName() == defaultProfileFileName) { _defaultProfile = profile; } } A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/570 True, it's a variation of the same solution you posted. :-) Same behaviour if you open a shell from dolphin with F4... (In reply to Axel Braun from comment #9) > Same behaviour if you open a shell from dolphin with F4... Both use-cases use the same code, so it should be fixed for both of them. (In reply to Ahmad Samir from comment #10) > (In reply to Axel Braun from comment #9) > > Same behaviour if you open a shell from dolphin with F4... > > Both use-cases use the same code, so it should be fixed for both of them. Confirmed. Git commit 10c306004210671579154947caaf9ea7f1d9b993 by Ahmad Samir. Committed on 03/01/2022 at 12:25. Pushed by ahmadsamir into branch 'master'. Use tighter matching when finding the default profile file name The code was checking if the path ended with a specific file name, which meant that if you have two profiles "Root Shell.profile" and "Shell.profile", the matching is messed up because the former ends with the latter. Instead since we're using the path, add a '/', this way we're matching the whole file name which is the last component in the path after the last '/'. Thanks to the bug reporter for git bisect'ing the repo to find the culprit commit. FIXED_IN: 21.12.0 M +1 -1 src/profile/ProfileManager.cpp https://invent.kde.org/utilities/konsole/commit/10c306004210671579154947caaf9ea7f1d9b993 Git commit eb44240235fa61e662e9a521f72e8be9213bb536 by Ahmad Samir. Committed on 03/01/2022 at 12:48. Pushed by ahmadsamir into branch 'release/21.12'. Use tighter matching when finding the default profile file name The code was checking if the path ended with a specific file name, which meant that if you have two profiles "Root Shell.profile" and "Shell.profile", the matching is messed up because the former ends with the latter. Instead since we're using the path, add a '/', this way we're matching the whole file name which is the last component in the path after the last '/'. Thanks to the bug reporter for git bisect'ing the repo to find the culprit commit. FIXED_IN: 21.12.0 M +1 -1 src/profile/ProfileManager.cpp https://invent.kde.org/utilities/konsole/commit/eb44240235fa61e662e9a521f72e8be9213bb536 |