Bug 393968 - Konsole doesn't always respect the --profile command-line option when run from a custom shortcut key.
Summary: Konsole doesn't always respect the --profile command-line option when run fro...
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Mint (Debian based) Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-07 19:15 UTC by rob
Modified: 2019-06-06 15:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
'launcher' script to launch or activate a konsole session based on a profile-set window title (158 bytes, application/x-shellscript)
2018-05-07 19:15 UTC, rob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rob 2018-05-07 19:15:02 UTC
Created attachment 112484 [details]
'launcher' script to launch or activate a konsole session based on a profile-set window title

version 16.04.03 (Mint 17.3 KDE)

I have konsole set up with several profiles, basically to generate different colored windows for various terminals I use to ssh into a development AIX system.  The profiles also specify a window title that I can search on to activate the window via a hotkey.

Anyway, I've set up a bunch of 'launcher' scripts that let me configure hotkeys to launch and re-activate these terminal sessions.  These scripts use xdotool to search for the window title, and either launch konsole or windowactivate the session if it's already running.

And it all works, except for some reason when I run the launcher to activate the terminal with profile 'rs2' from a custom kwin shortcut, it launches konsole, but the profile doesn't take.  Other launchers that differ only by the profile name work fine.  And the rs2 launcher works fine if I run it from another konsole window.  Just not when I run it from my hotkey.  So the first time I launch my 'rs2' session, I need to manually select the profile after it starts.  Again, this doesn't happen for other sessions with their own profiles.

I'm attaching the launcher script.  Again, a second launcher script that differs from this one only with respect to the window title and profile used works from a custom shortcut key.  Here are the diffs between the two:

rob@ry-desktop ~/bin/launchers $ diff launchjds.sh launchrs2.sh
3c3
< pid=`xdotool search --name jds`
---
> pid=`xdotool search --name rob`
6c6
<       konsole --profile jds -e ssh jds@rs2&
---
>       konsole --profile rs2 -e ssh rob@rs2&
Comment 1 Kurt Hindenburg 2018-05-14 02:49:55 UTC
I'm thinking perhaps something in rs2 profile that might be causing this.  Can you attach it?  Also, the version is rather old; are you able to upgrade?
Comment 2 rob 2018-05-14 13:40:45 UTC




 

I apologize for the old version - it's what the latest Mint KDE system includes, so there's that...

Below is a diff of the two profiles.  The only difference besides the title and color scheme is that the jds profile had Command=/bin/bash, and the rs2 profile had no Command setting (even though the profile manager showed /bin/bash).

I changed modified the rs2 profile and then changed it back to get the Command setting fixed, but it doesn't change anything.  Note that my launcher script overrides the command anyway by running ssh in the konsole session like so:

               konsole --profile rs2 -e ssh rob@rs2&

Anyway, I've also tried a few other things.  I copied jds.profile to rs2.profile, and that does not work - so it's not something in the .profile file itself.  Then I edited my launchrs2.sh script to use the jds profile, and that does work (although, of course, with the jds profile, which I don't want). 

So still, for some reason, the rs2 profile does not work from the command line when the launchrs2.sh script is run via a custom shortcut key.  But again, it *does* work when the same launchrs2.sh script is run from the command line within konsole.  Pretty strange, right?

here's the diff of the original profiles - though I think I've eliminated this as the problem.

rob@ry-desktop ~/.local/share/konsole $ diff jds.profile rs2.profile
2c2
< ColorScheme=light blue
---
> ColorScheme=BlackOnLightYellow
5,7c5,6
< Command=/bin/bash
< LocalTabTitleFormat=jds: %n
< Name=jds
---
> LocalTabTitleFormat=rs2: %n
> Name=rs2
Comment 3 rob 2018-05-14 14:01:09 UTC
Actually, y'know what.  It does seem to be using the rs2 profile - in that the title bar shows up as "(rob) rs2 -- Konsole", which is what I count on for re-activating the window on the next custom shortcut keypress.  So all that's not working is that the light yellow color scheme is not activated on launch.  I use to visually identify the rs2 window after it's up.

What I've been doing is launching rs2 with my Ctrl-Alt-2 shortcut and then selecting the rs2 profile from the Settings menu once it launches.  After that I'm okay.  So if you can't reproduce this problem in a later version of konsole, maybe it's not worth worrying about.
Comment 4 rob 2018-05-22 16:45:08 UTC
For what it's worth, I just upgraded to Kubuntu 18.04 (Konsole version 17.12.3), and the behavior is the same.
Comment 5 rob 2019-06-06 15:09:59 UTC
I don't know if this helps, but I just discovered that if I enter my launcher command as:

     konsole --profile rs2.profile

the colors and the titlebar text take.  But if I launch it as:

     konsole --profile rs2

the titlebar text takes, but not the colors.  Weird, huh?  The rs2.profile trick is a useful workaround, but it's a strange bug, no?