Profile shortcuts switch profile instead of opening new tab
ClosedPublic

Authored by thsurrel on Dec 5 2018, 10:08 PM.

Details

Summary

This is a proposal to modify the profile shortcuts behaviour:
instead of opening a new tab with the corresponding profile
they now switch the profile of the current terminal display.

FEATURE: 319926

Diff Detail

Repository
R319 Konsole
Branch
arc_profileshortcuts (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5949
Build 5967: arc lint + arc unit
thsurrel created this revision.Dec 5 2018, 10:08 PM
Restricted Application added a project: Konsole. · View Herald TranscriptDec 5 2018, 10:08 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
thsurrel requested review of this revision.Dec 5 2018, 10:08 PM

I don't really know how to test this in the embedded terminal in Kate for example. Could someone provide some guidance ?

I don't really know how to test this in the embedded terminal in Kate for example. Could someone provide some guidance ?

You can try to use the demo_konsolepart in src/tests/demo_konsolepart/ - or try to copy the home built konsolepart.so to a location the other apps will find them. (Depending on OS/distro exampe: /usr/lib/x86_64-linux-gnu/qt5/plugins/). If you have your distros konsole/konsolepart installed, it might cause issues.

I don't think I agree that using a profile shortcut should switch the current tab to that profile. What would be rationale for this change?

I don't think I agree that using a profile shortcut should switch the current tab to that profile. What would be rationale for this change?

I would say "Expectations", when I go to the profile I expect it to switch the currently focused terminal to that profile, if the button was labelled "new terminal with profile" then I would be against that change. I belive both variants could coexist.

thsurrel added a comment.EditedDec 13 2018, 12:54 PM

Two other things:

  • there is already a shortcut to open a new tab (Ctrl-Shift-t), but nothing to change the profile of the current terminal. With this patch you can do everything from the keyboard.
  • as suggested in FEATURE: 319926, some users (me included) would like to be able to quickly switch temporarily to another profile and back.

I would say "Expectations", when I go to the profile I expect it to switch the currently focused terminal to that profile,

+1

OK, I never really use switch unless I'm testing something - I'll look at the code

Can you look the change I requested - a quick coding here seems to work w/ the changes.

src/SessionController.cpp
226

This isn't good; instead of putting getProfileList() in ViewManager, put it in ProfileManager (without QObject) and then do '_profileList = ProfileManager::instance()->getProfileList();
'

thsurrel updated this revision to Diff 48419.Dec 30 2018, 9:24 PM

Fix requested by hindenburg
Thank you very much for the review

hindenburg accepted this revision.Dec 30 2018, 11:07 PM

This is very nice - thanks for working on this and staying with it. Good catch with the read only code.

This revision is now accepted and ready to land.Dec 30 2018, 11:07 PM
This revision was automatically updated to reflect the committed changes.
thiago added a subscriber: thiago.Jun 5 2019, 6:01 PM

Is anyone working on the ability to open a new profile? I ask this because I had a shortcut assigned to open a root shell (Ctrl+Alt+R) and was quite surprised to find out that it didn't work anynore with no way to get it back. This is not the same as opening a new tab and switching profiles, since that won't change the command that was started.

Please re-add the feature to open a new shell. Please make the key assignments in the user's config that opened new sessions still open new sessions. You can add new shortcuts for switching profiles, but they should not inherit the existing shortcuts.

Anyone have anything to say about Thiago's comment? There's now only one shortcut to open a new tab.

Anyone have anything to say about Thiago's comment? There's now only one shortcut to open a new tab.

Something needs to be done here before 19.08. Since switching profiles doesn't not run the Command, it makes certain profiles worthless (root, ssh, etc). I'd be tempted to allow user to select what shortcut does per profile, switch or new.

If I can't find a good way to re-do this by July 13th, I'm going to revert this.

Sorry, I don't have much time for KDE lately unfortunately. As the author of this patch, I would have like to help ...

Just a quick thought: when switching profiles, could we simply run the command of the new profile if, and only if, it is different than the command of the profile we are leaving ?

Running the command would be a step that needs fixed when switching profiles regardless. However, I think we need the option to have shortcuts open new profile tabs. I had plans to try to work on it this week and if I can't find something revert it for 19.08.

mglb added a subscriber: mglb.Jul 2 2019, 1:08 PM

Since actions: new tab with profile and switch to profile are already in menus, they could be added to Configure Shortcuts window (both actions for each profile). In such case shortcut editor in profile manager should be removed.