From b641f560944da85a831fe79a95eb1a82a078d48c Mon Sep 17 00:00:00 2001 From: Kent Tonino Date: Thu, 9 Apr 2026 22:38:55 +0800 Subject: [PATCH] fix: activate already created shell --- src/poetry_plugin_shell/command.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/poetry_plugin_shell/command.py b/src/poetry_plugin_shell/command.py index 234ac85..cf1e4cd 100644 --- a/src/poetry_plugin_shell/command.py +++ b/src/poetry_plugin_shell/command.py @@ -34,6 +34,13 @@ def handle(self) -> int: f"Virtual environment already activated: {self.env.path}" ) + # Activate the shell. + env = self.env + assert env.is_venv() + env = cast("VirtualEnv", env) + shell = Shell.get() + shell.activate(env) + return 0 self.line(f"Spawning shell within {self.env.path}")