Bug 460383 - Custom profiles do not remain saved after Konsole is restarted
Summary: Custom profiles do not remain saved after Konsole is restarted
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 22.08.1
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-13 17:30 UTC by Guilherme Procópio
Modified: 2023-03-20 18:51 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 22.12.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guilherme Procópio 2022-10-13 17:30:12 UTC
STEPS TO REPRODUCE
1.  Open the Konsole and create a new custom profile, save and set as default.
2. Close the Konsole.
3. Open the Konsole and you'll see that the only profile available is the Built-in set as default, despite the previous change.

OBSERVED RESULT
The created profiles are deleted and Konsole returns to the default profile.

EXPECTED RESULT
That custom profiles remain personalized and that the app does not revert to the default configuration without user consent.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Debian Sid - Unstable
(available in About System)
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Comment 1 Vladislav Rubtsov 2022-10-20 00:06:24 UTC
I have the same bug in the current Debian Testing, which also uses Konsole v.22.08.1

My observations:
- When you create a new profile and set it as default, its path *does get* saved to Konsole config, but the profile file itself is never written to.
- After creating a new profile, open `~/.config/konsolerc`. You should see profile file name  `[Desktop Entry]` section.
- The profile itself should be saved in `~/.local/share/konsole/Your Profile Name.profile`, but this doesn't happen.
- However, Konsole likely thinks profile *save was successful*. Otherwise, it's programmed to display an error message.

I was able to bypass this bug by manually creating `~/.local/share/konsole/Your Profile Name.profile` (I actually copied it over from my Debian 11 installation, where Konsole isn't buggy).

When the profile file was present that matched `[Desktop Entry] > DefaultProfile` in `~/.config/konsolerc`, it was loading successfully, and I was able to both edit and rename it.
Comment 2 Vladislav Rubtsov 2022-10-20 00:14:28 UTC
Alright, if anyone else suffers from this bug and wants a quick fix, you can copy-paste my profile data as a placeholder, then edit it to your liking (editing should work fine).

WORKAROUND:
1. In Konsole, open Settings > Manage Profiles...
2. Create a new profile name `Your Profile Name.profile`, SET IT AS A DEFAULT ONE.
3. Exit Konsole. YOUR PROFILE WON'T BE SAVED DUE TO A BUG, but it's path will be written to `~/.config/konsolerc` (see my comment above for details).
4. Manually create a file `~/.local/share/konsole/Your Profile Name.profile`. You can use my data as a placeholder:

* * *
[Appearance]
AntiAliasFonts=true
BoldIntense=true
ColorScheme=Breeze
DimmValue=128
Font=Consolas,12,-1,5,50,0,0,0,0,0
LineSpacing=0
TabColor=invalid
UseFontLineChararacters=false

[Cursor Options]
CursorShape=0
CustomCursorColor=255,255,255
CustomCursorTextColor=0,0,0
UseCustomCursorColor=false

[Encoding Options]
DefaultEncoding=UTF-8

[General]
Command=/bin/bash
DimWhenInactive=false
Environment=TERM=xterm-256color,COLORTERM=truecolor
Icon=utilities-terminal
LocalTabTitleFormat=%d : %n
Name=Profile 4
RemoteTabTitleFormat=(%u) %H
ShowTerminalSizeHint=true
SilenceSeconds=10
StartInCurrentSessionDir=true
TerminalCenter=false
TerminalColumns=110
TerminalMargin=1
TerminalRows=28

[Interaction Options]
AllowEscapedLinks=false
AlternateScrolling=true
AutoCopySelectedText=false
CopyTextAsHTML=true
CtrlRequiredForDrag=true
DropUrlsAsText=true
EscapedLinksSchema=http://;https://;file://
MiddleClickPasteMode=0
MouseWheelZoomEnabled=true
OpenLinksByDirectClickEnabled=false
PasteFromClipboardEnabled=false
PasteFromSelectionEnabled=true
TrimLeadingSpacesInSelectedText=false
TrimTrailingSpacesInSelectedText=false
TripleClickMode=0
UnderlineFilesEnabled=false
UnderlineLinksEnabled=true
WordCharacters=:@-./_~?&=%+#

[Keyboard]
KeyBindings=default

[Scrolling]
HighlightScrolledLines=true
HistoryMode=1
HistorySize=1000
ScrollBarPosition=1
ScrollFullPage=false

[Terminal Features]
BellMode=1
BidiRenderingEnabled=true
BlinkingCursorEnabled=false
BlinkingTextEnabled=true
FlowControlEnabled=true
PeekPrimaryKeySequence=
ReverseUrlHints=false
UrlHintsModifiers=0
VerticalLine=false
VerticalLineAtChar=80

* * *

Notice I use Consolas font in this config. I don't think it will break if you don't have it.

5. Try loading Konsole again. You should now be able to load and edit `Your Profile Name`.
Comment 3 Josh Taylor 2022-10-20 05:16:06 UTC
The workaround that works for me was outlined in this reddit post: https://old.reddit.com/r/kde/comments/y45vnk/konsole_profiles_arent_saving_why/iscl1vn/

"A workaround I found is to create a new profile then immediately press ok to exit the menus first. That should make the new profile safe for configuration."

I can confirm this works for me as well, on 22.08.2.
Comment 4 Bug Janitor Service 2022-12-23 12:39:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/792
Comment 5 Kurt Hindenburg 2022-12-27 17:45:16 UTC
Git commit 53c3839e6048b28aef4dda79c7a8dfefaa3e484b by Kurt Hindenburg, on behalf of Fabian Vogt.
Committed on 27/12/2022 at 16:59.
Pushed by hindenburg into branch 'master'.

Fix saving new profiles

When using the "Apply" button in the "Create new profile" dialog, the profile
was saved but the dialog remained in the "new profile" state. This meant that
when clicking on "Apply" again or accepting the dialog, it saved the profile
from scratch instead of editing the existing one. The ProfileManager
interpreted that as a rename because the "Name"/"UntranslatedName" properties
were set and decided to delete the profile at its "old" (== current) path.

M  +2    -0    src/widgets/EditProfileDialog.cpp

https://invent.kde.org/utilities/konsole/commit/53c3839e6048b28aef4dda79c7a8dfefaa3e484b
Comment 6 Kurt Hindenburg 2022-12-30 18:03:54 UTC
Git commit 9566ed97d0d2e85f27790ab8f1d89ac0c9ad4373 by Kurt Hindenburg, on behalf of Fabian Vogt.
Committed on 30/12/2022 at 16:49.
Pushed by hindenburg into branch 'release/22.12'.

Fix saving new profiles

When using the "Apply" button in the "Create new profile" dialog, the profile
was saved but the dialog remained in the "new profile" state. This meant that
when clicking on "Apply" again or accepting the dialog, it saved the profile
from scratch instead of editing the existing one. The ProfileManager
interpreted that as a rename because the "Name"/"UntranslatedName" properties
were set and decided to delete the profile at its "old" (== current) path.

M  +2    -0    src/widgets/EditProfileDialog.cpp

https://invent.kde.org/utilities/konsole/commit/9566ed97d0d2e85f27790ab8f1d89ac0c9ad4373