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}")