diff --git a/jupyter_server/services/sessions/sessionmanager.py b/jupyter_server/services/sessions/sessionmanager.py index c3c6edc7ef..d1d61dbf46 100644 --- a/jupyter_server/services/sessions/sessionmanager.py +++ b/jupyter_server/services/sessions/sessionmanager.py @@ -138,7 +138,9 @@ async def start_kernel_for_session(self, session_id, path, name, type, kernel_na # allow contents manager to specify kernels cwd kernel_path = self.contents_manager.get_kernel_path(path=path) kernel_id = await self.kernel_manager.start_kernel( - path=kernel_path, kernel_name=kernel_name + path=kernel_path, + kernel_name=kernel_name, + env={"JPY_SESSION_NAME": str(pathlib.Path(path).resolve())}, ) return kernel_id