Bug 421926 - Konsole new tabs do not respect --profile argument
Summary: Konsole new tabs do not respect --profile argument
Status: CONFIRMED
Alias: None
Product: konsole
Classification: Applications
Component: tabbar (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-22 17:56 UTC by Fernando
Modified: 2021-01-02 14:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando 2020-05-22 17:56:37 UTC
SUMMARY
Konsole does not respect profile for every new tab when the profile was mentioned at the execution.

STEPS TO REPRODUCE
1. execute: konsole --profile ~/profilename.profile &
2. try to open a new tab


OBSERVED RESULT
Main tab is opened with the profile used when it was executed but no the new tabs; they are taking the profile from konsolerc file. It must still use the profile 

EXPECTED RESULT
All tabs must be using the profile used in konsole --profile execution.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: RHEL 7
(available in About System)
KDE Plasma Version: 4.11.19
KDE Frameworks Version: 4.14.18
Qt Version: 4.8.7

ADDITIONAL INFORMATION
Comment 1 Oswald Buddenhagen 2020-10-09 09:25:41 UTC
when you open a new tab via the menu, you get to select the profile interactively, so that's obviously not the issue here.

the issue manifests when the "new tab" action is activated via a key binding, as it does indeed always use the default profile.

one way to deal with that would be indeed respecting the --profile option as you suggest.

another way would be using the profile of the current tab. there is a precedent for this in form of the profile option to use the current tab's working directory.

a third option would be a combination of the two: use --profile if specified, otherwise fall back to current profile. though this would make the behavior somewhat inconsistent, so it might be a tad confusing.
Comment 2 Gustavo Carneiro 2020-10-20 05:26:13 UTC
This bug is fixed in the PR https://invent.kde.org/utilities/konsole/-/merge_requests/252 awaiting review and merging.
Comment 3 Kurt Hindenburg 2020-10-21 02:41:33 UTC
This has always been the behavior.  Opening a new tab via the default shortcut always uses the default profile.

"Fixing" this would be a change in behavior.

The patch in the MR uses the 3rd option suggested by Oswald which IMHO is confusing.
Comment 4 Gustavo Carneiro 2020-10-21 04:05:40 UTC
I really believe that the third option should be the default behavior in case the profile is specified using --profile, even in a new tab, as this is the look that best fits our view.

I am open to suggestions if they feel necessary.
Comment 5 Oswald Buddenhagen 2020-10-21 10:03:05 UTC
i don't see why changing the behavior should be a notable problem in this case.

anyway, how about separate actions? new-tab-default (aliased to the current new-tab), new-tab-current, new-tab-selected, and new-tab-smart (yay, who doesn't like an explosion of options).
Comment 6 Gustavo Carneiro 2020-10-21 21:58:15 UTC
Oswald, allow me to disagree with you, I believe that many options end up confusing users, in this case, I also believe that the behavior should be standard in the case of using the --profile argument for the entire instance of the application that is running. It is worth noting that other instances assume the current behavior.
Comment 7 Oswald Buddenhagen 2020-10-21 22:53:22 UTC
the wording was fairly indicative of sarcasm. ;)

anyway, having multiple additional actions wouldn't be that bad in this case, as they would appear only in the shortcut config dialog (they aren't relevant for the menu, as i already pointed out). it would be also ok to have only one additional action, and possibly make its exact behavior configurable in the profile (though such a micro-option would add mostly useless clutter). i for one don't really care which of the proposed behaviors the new action would have, as my usage pattern is basically one profile per window, so they'd all do the same thing. but if i had to choose, i'd use my 2nd option, as it's most consistent with existing functionality (cf. $PWD).
Comment 8 Justin Zobel 2020-11-01 05:09:50 UTC
Thoughts on a command line only option so konsole --all-tabs-use-profile=myprofile ?
Comment 9 Oswald Buddenhagen 2020-11-01 10:03:42 UTC
--all-tab-profile=... maybe, to make it less verbose.
note that this is lacking the "copy current" mode. one could add --new-tab-profile={default,current,smart} instead, but that just shifts the additional choices to the command line, so it's not much of an improvement.
Comment 10 Oswald Buddenhagen 2021-01-02 14:05:33 UTC
so, there already is an action which is (mostly?) equivalent with the proposed new-tab-current: clone-tab.

and as indicated on gitlab, the maintainers seem to be fine with changing the meaning of new-tab to heed the command line override.

so we end up with two actions with rather obvious semantics. seems like a sensible outcome to me.