The following escape sequence will cause Konsole to reset to current profile defaults: printf '\033]50;anything\007\033\\' This escape sequence is commonly used in vim to change cursor shape (in that case replace 'anything' with CursorShape=1 or CursorShape=0) I think I've been able to track this one down. This is likely related to #323227 TLDR: Here we see UserTitleChange::ProfileCHange enum value of 50: https://projects.kde.org/projects/kde/applications/konsole/repository/revisions/master/entry/src/Session.h#L358 I am not set up to build or test Konsole, or I'd submit a patch for this, but I *think* that finding a safe(?) value for ProfileChange attribute - perhaps something > 255 since an escape sequence should never triggers this - will resolve it. More details: In Vt102Emulation.cpp, first: https://projects.kde.org/projects/kde/applications/konsole/repository/revisions/master/entry/src/Vt102Emulation.cpp#L282 : #define Xpe (tokenBufferPos >= 2 && tokenBuffer[1] == ']') // evals true in this case #define Xte (Xpe && cc = 7) // evals true in this case And then in receiveChar: https://projects.kde.org/projects/kde/applications/konsole/repository/revisions/master/entry/src/Vt102Emulation.cpp#L321 // Xte evals true in this case if (Xte ) { processWindowAttributeChange(); resetTokenizer(); return; } processWindowAttributeChange looks at the token buffer which is: // '\033]50;anything\007\033\\' [0] = ESC [1] = ']' [2] = '5' [3] = '0' [4] = ';' Assigns attributeToChange = 50 This then gets emitted in a titleUpdate - and the changed attribute now corresponds to the ProfileChange attribute. Session sees that it changed and does what it thinks is correct - calls for a reset of the profile.
IINM, this is the same as bug 323227, using an escape sequence to change a profile property doesn't reset the profile settings but actually creates a new temporary profile (that's actually a copy of the current profile), and that temporary profile has an empty name. *** This bug has been marked as a duplicate of bug 323227 ***