https://bugs.kde.org/show_bug.cgi?id=528418

            Bug ID: 528418
           Summary: konsoleprofile no longer works since 26.08.3: OSC 50
                    drops all non-cursor profile properties (ColorScheme,
                    TabColor, ...)
    Classification: Applications
           Product: konsole
      Version First 26.08.3
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: emulation
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY
Since Konsole 26.08.3, the OSC 50 profile change sequence (ESC ] 50 ;
Property=Value BEL) ignores every property except CursorShape,
BlinkingCursorEnabled,
AnimatingCursorEnabled and CustomCursorColor. This breaks the konsoleprofile
script that Konsole itself ships and documents. Its own usage example,
konsoleprofile
"ColorScheme=WhiteOnBlack;TabColor=#FF0000", now does nothing. It fails
silently, with no warning or debug output.

The change is commit 67f1f225 "Vt102: Only accept cursor commands" (backported
to release/26.08 as f18710cf). It removed the else branch in
Vt102Emulation::sessionAttributeChanged-related OSC 50 handling that forwarded
other items to Session::ProfileChange. I understand the security reasoning:
letting any
program writing to the terminal change arbitrary profile properties is a real
risk. However, this removed a documented, user-facing feature in a patch
release, without
a changelog entry or a replacement.

STEPS TO REPRODUCE
1. Open a Konsole 26.08.3 tab.
2. Run: konsoleprofile ColorScheme=BlackOnWhite
   (or: printf '\033]50;ColorScheme=BlackOnWhite\a')

OBSERVED RESULT
Nothing changes. The color scheme stays the same.

EXPECTED RESULT
The current tab switches to the BlackOnWhite color scheme, as in 26.08.2 and
earlier, and as described in /usr/bin/konsoleprofile.

IMPACT
Tools and shell setups that colour the terminal by context (ssh, docker,
sudo/root shells, production hosts) rely on this. It is a well-known safety aid
against typing
commands into the wrong host. Selecting a color scheme from the menu still
works, but it can't be automated per command. D-Bus Session.setProfile() is not
a
replacement: it switches whole profiles rather than overriding one property for
the current tab.

SUGGESTED SOLUTIONS (any of these)
- Allow-list harmless appearance properties in addition to cursor ones, e.g.
ColorScheme and TabColor (properties that cannot run commands, change
environment, or touch
files).
- Add a profile option (e.g. "Allow programs to change profile properties via
escape sequences", default off) that restores the previous behaviour.
- Provide a supported replacement (e.g. a D-Bus method on Session to set a
runtime profile property for the current tab) and update konsoleprofile to use
it.
- At minimum, update or remove konsoleprofile and its documentation, since it
can no longer do what it advertises.

SOFTWARE/OS VERSIONS
Konsole: 26.08.3 (26.08.2 works)
Linux: Exherbo, kernel 7.2.13
(add KDE Frameworks / Qt / Plasma versions from Help > About Konsole)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to