[utilities/konsole/release/26.08] src: ViewManager: Add container loading back to createSession

Akseli Lahtinen <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit d67da292365c68b5750032fdbdd8b610c2bc887f by Akseli Lahtinen.
Committed on 10/08/2026 at 09:09.
Pushed by akselmo into branch 'release/26.08'.

ViewManager: Add container loading back to createSession

This had been mistakenly removed so it would not load
containers anymore. Adding it back.


(cherry picked from commit 402aa9d4f5fdc814df7006aef3b9f722dae56712)

Co-authored-by: Akseli Lahtinen <[email protected]>

M  +10   -0    src/ViewManager.cpp

https://invent.kde.org/utilities/konsole/-/commit/d67da292365c68b5750032fdbdd8b610c2bc887f

diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index 1beba290d..0bba0756a 100644
--- a/src/ViewManager.cpp
+++ b/src/ViewManager.cpp
@@ -669,6 +669,16 @@ Session *ViewManager::createSession(const Profile::Ptr &profile, const QString &
             session->setContainerContext(activeSession->containerContext());
         }
     }
+    // If we are not in container, set it according to profile
+    if (!session->isInContainer()) {
+        const QString configuredContainer = profile ? profile->containerName() : QString();
+        if (!configuredContainer.isEmpty() && ContainerRegistry::instance()->isEnabled()) {
+            const ContainerInfo container = ContainerRegistry::instance()->containerInfoFromKey(configuredContainer);
+            if (container.isValid()) {
+                session->setContainerContext(container);
+            }
+        }
+    }
 
     updateAutoContainerTabColor(session);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.