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

--- Comment #1 from Alain Knaff <k...@kde.lka.org.lu> ---
I started investigating this in more detail, and here is what I found:

1. Session::setSessionAttribute gets invoked as soon as the ANSI sequence is
received.
2. Session::setSessionAttribute copies the "caption" method parameter to the
_userTitle object attribute, and sets local variable modified to true (if title
did indeed change)
3. Near the end, it emits sessionAttributeChanged() if modified
4. SessionController::sessionAttributeChanged() indeed activates immediately
(good), and attempts to set the title using ViewProperties::setTitle
5. However, it gets the "wrong" title to set. In step #2, session._userTitle
was set, however, sessionAttributeChanged() gets session._displayName (via
session()->title(Session::DisplayedTitleRole);)
6. 2 seconds later, _userTitle gets copied over to _displayTitle by
Session::setTitle, and ViewProperties::setTitle gets invoked again, and this
time succeeds in setting the correct (i.e. new) title.

=> The immediate invocation of step #4 shows that there is indeed an intent to
perform the title update promptly. However, step #6 (or equivalent) should be
invoked before it as well.

The following patch is a stop-gap measure which fixes the issue:
--- konsole-orig/konsole-22.12.3/src/session/Session.cpp        2023-02-27
05:02:33.000000000 +0100
+++ konsole-22.12.3/src/session/Session.cpp     2023-07-25 22:03:35.518283329
+0200
@@ -537,6 +537,7 @@
     if ((what == IconNameAndWindowTitle) || (what == WindowTitle)) {
         if (_userTitle != caption) {
             _userTitle = caption;
+            _displayTitle = caption;
             modified = true;
         }
     }

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

Reply via email to