SUMMARY Likely after update from 21.08.3 to 21.12.0, konsole starts with Root Shell profile as the default. STEPS TO REPRODUCE 1. run konsole 2. set some profile (not the Root Shell) as default 3. run konsole 4. the Root Shell is reset as default again OBSERVED RESULT In step 3, Root Shell is started EXPECTED RESULT The selected profile from step 2 should start. SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20220101 KDE Plasma Version: 5.23.4 KDE Frameworks Version: 5.89.0 Qt Version: 5.15.2 Kernel Version: 5.15.10-1.g85804f3-default (64-bit) Graphics Platform: Wayland Processors: 4 × Intel® Core™ i7-6600U CPU @ 2.60GHz Memory: 15.3 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 520 ADDITIONAL INFORMATION $ grep ltProfile ~/.config/konsolerc DefaultProfile=Shell.profile $ cat /home/xslaby/.local/share/konsole/Shell.profile [Appearance] AntiAliasFonts=false ColorScheme=WhiteOnBlack DimmValue=43 Font=Misc Fixed,10,-1,5,57,0,0,0,0,0,SemiCondensed UseFontLineChararacters=true [Cursor Options] CursorShape=0 [General] DimWhenInactive=true InvertSelectionColors=true LocalTabTitleFormat=%d : %n (%w) Name=Shell Parent=FALLBACK/ TerminalColumns=80 TerminalRows=25 [Keyboard] KeyBindings=default [Scrolling] BlinkingCursorEnabled=false HistorySize=10000 ScrollBarPosition=2 VerticalLine=true
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