From ffc52ec97aaeabd62c8ebbebe0d4758950fa65d1 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Thu, 4 Jun 2026 10:10:57 +0900
Subject: konsole: add documentation for OSC extensions 30/31/32

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 konsole/konsole/session.cpp | 17 +++++++++--------
 konsole/tips                | 18 ++++++++++++------
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/konsole/konsole/session.cpp b/konsole/konsole/session.cpp
index 4a3b1975e..1921bf9ce 100644
--- a/konsole/konsole/session.cpp
+++ b/konsole/konsole/session.cpp
@@ -214,23 +214,24 @@ void TESession::changeTabTextColor( int color )
 void TESession::setUserTitle( int what, const TQString &caption )
 {
     // (btw: what=0 changes title and icon, what=1 only icon, what=2 only title
-    if ((what == 0) || (what == 2))
+    if (what == 0 || what == 2)
        userTitle = caption;
-    if ((what == 0) || (what == 1))
+    if (what == 0 || what == 1)
        iconText = caption;
     if (what == 11) {
       TQString colorString = caption.section(';',0,0);
       TQColor backColor = TQColor(colorString);
       if (backColor.isValid()){// change color via \033]11;Color\007
-	if (backColor != modifiedBackground) {
-	    modifiedBackground = backColor;
-	    te->setDefaultBackColor(backColor);
-	}
+        if (backColor != modifiedBackground) {
+          modifiedBackground = backColor;
+          te->setDefaultBackColor(backColor);
+        }
       }
     }
-    if (what == 30)
+    // 30/31/32 are OSC extensions that are not part of the official XTerm documentation
+    if (what == 30)   // rename session via \033]30;<new name>\007
        renameSession(caption);
-    if (what == 31) {
+    if (what == 31) { // open specific folder via \033]31;<folder name>\007
        cwd=caption;
        cwd=cwd.replace( TQRegExp("^~"), TQDir::homeDirPath() );
        emit openURLRequest(cwd);
diff --git a/konsole/tips b/konsole/tips
index dbc3631f4..8216c68a9 100644
--- a/konsole/tips
+++ b/konsole/tips
@@ -178,23 +178,29 @@ text while pressing the Shift key?
 <tip category="Konsole">
 <html>
 <p>...that you can let Konsole set the current directory as the window title?
-For Bash, put 'export PS1=$PS1"\[\e[0m\H:\w\a\]"' in your ~/.bashrc .
+For Bash, put 'export PS1=$PS1"\[\e]0;\H:\w\a\]"' in your ~/.bashrc.
 </html>
 </tip>
 
 <tip category="Konsole">
 <html>
 <p>...that you can let Konsole set the current directory as the session name?
-For Bash, put 'export PS1=$PS1"\[\e[30m\H:\w\a\]"' in your ~/.bashrc .
+For Bash, put 'export PS1=$PS1"\[\e]30;\H:\w\a\]"' in your ~/.bashrc.
 </html>
 </tip>
 
 <tip category="Konsole">
 <html>
-<p>...that if you let your shell pass the current directory to Konsole within the prompt
-variable, e.g. for Bash with 'export PS1=$PS1"\[\e[31m\w\a\]"' in your ~/.bashrc, then
-Konsole can bookmark it, and session management will remember your current working directory
-on non-Linux systems too?
+<p>...that if you open a terminal in Konqueror and you let your shell pass the current
+directory to the prompt variable, e.g. for Bash with 'export PS1=$PS1"\[\e]31;\w\a\]"' then
+Konqueror will automatically sync its location every time you change folder in the terminal?
+</html>
+</tip>
+
+<tip category="Konsole">
+<html>
+<p>...that you can set Konsole session's icon from a script with: "echo -ne '\e]32;&lt;icon&gt;\a'",
+where &lt;icon&gt; is either an icon name or a full path?
 </html>
 </tip>
 
-- 
cgit v1.2.3

