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

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

ViewManager: Add container loading back to createSession

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

M  +10   -0    src/ViewManager.cpp

https://invent.kde.org/utilities/konsole/-/commit/402aa9d4f5fdc814df7006aef3b9f722dae56712

diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp
index 6ba7204b8..563e5a031 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.