Bug 433160 - Confusing implementation of profiles - temporary changes, saving etc
Summary: Confusing implementation of profiles - temporary changes, saving etc
Status: ASSIGNED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-02-18 11:44 UTC by Jonathan Marten
Modified: 2022-11-03 15:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Blank entries in New Tab menu (140.64 KB, image/png)
2022-11-03 15:26 UTC, TraceyC
Details
Blank entries in Settings - Switch Profile (169.22 KB, image/png)
2022-11-03 15:27 UTC, TraceyC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2021-02-18 11:44:33 UTC
SUMMARY

Konsole's profile system works as intended for permanent profiles saved.  However, some confusion arises when temporary changes cause a new profile to be generated, which happens without any indication to the user and changes the way that editing the profile works.

For example, start Konsole with the default settings, then "Edit Current Profile".  Any changes can be made, and then "OK" or "Apply" applies the settings and updates the saved profile permanently.  So far so good.

Then start Konsole again with a seemingly innocuous change, e.g. with "--workdir /tmp".  Then do "Edit Current Profile" again and try to change the appearance (without noticing that the profile name on the "General" page is now blank).  Either "OK" or "Apply" gives the message "Each profile must have a name before it can be saved into disk" (which is badly worded, and also shows in two message boxes in succession) and nothing happens.

Even if nothing is changed on the command line, executing an escape sequence which changes a profile property (e.g. as described in bug 323227) will do the same.

The effect of this is that the user cannot change anything, even if they only want the change to be temporary for the current session, without having to enter a name and saving the profile.  Even if they realise what is happening it is not possible to simply enter the original name and overwrite the saved profile, because it already exists and there is no option to overwrite it.


SUGGESTED SOLUTION

Retain the current "Edit Current Profile" action and dialogue, but separate its eventual result into two distinct "change the current session" and "save the profile permanently" actions.  This could be done by having a "Save" button in addition to "OK" and "Apply".  There could also be, if the profile is a temporary one (i.e. it has no name and is not saved), a message something like "This is a temporary profile, please enter a name to save it".

Clicking "Save" will save the profile to disc, with an error message if it has no name or an overwrite warning if the name already exists.  This should be the default button if the profile is not temporary, and if the save is successful should also have the effect of "OK".

Clicking "OK" or "Apply" will apply the profile to the current session, without insisting that the profile has a name or saving it.  "OK" should be the default button if the profile is temporary.
Comment 1 Bug Janitor Service 2021-04-22 11:49:51 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/379
Comment 2 Bug Janitor Service 2021-05-19 08:31:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/392
Comment 3 Kurt Hindenburg 2021-07-23 16:06:49 UTC
Git commit 512ce4403d0f7fa696cdfe41256afe35398c4f87 by Kurt Hindenburg, on behalf of Ahmad Samir.
Committed on 23/07/2021 at 16:06.
Pushed by hindenburg into branch 'master'.

Don't create a new temp profile when --workdir is used to launch Konsole

Instead set the Session initial working directory.
Related: bug 435537, bug 419859

M  +14   -18   src/Application.cpp

https://invent.kde.org/utilities/konsole/commit/512ce4403d0f7fa696cdfe41256afe35398c4f87
Comment 4 TraceyC 2022-11-03 15:26:00 UTC
Created attachment 153440 [details]
Blank entries in New Tab menu
Comment 5 TraceyC 2022-11-03 15:26:32 UTC
I found this bug looking to see why a bunch of profiles with no names were appearing in Konsole after launching it from command line. The undesired behavior isn't just triggered by --workdir. It is also triggered when using command line to open a new tab and run a command. There may be other triggers, but I haven't investigated.

I wanted to add a related UI bug that I have observed.

## Steps to reproduce
1. Launch Konsole from command line. Pass a shell command. 
  Which shell is irrelevant, this happens for me with bash, zsh and fish.
  The command doesn't seem to matter. 
e.g.
`konsole --new-tab -e bash -c 'ls -la ~/some_directory; cd  ~/Nextcloud/Notes/; bash'`

## Additional observations
I see the problems outlined in the original writeup with the current profile having no name. Additionally, I see a new profile with a blank name in Settings - Switch Profile. These nameless entries also appear when clicking and holding the New Tab  icon. 

A new blank entry is added every time a command like the above is run, resulting in multiple blank entries throughout the day.
These entries don't go away until Konsole is restarted. 

I've attached screenshots of the blank entries in the UI.
Comment 6 TraceyC 2022-11-03 15:27:32 UTC
Created attachment 153441 [details]
Blank entries in Settings - Switch Profile
Comment 7 TraceyC 2022-11-03 15:33:29 UTC
(In reply to TraceyC from comment #5)
I wanted to add the behavior I expected.
* If I launch konsole from command line without specifying a profile, it uses my default profile (not a temp / blank profile.)
* If launched with --profile it uses that profile (not a temp / blank profile)