jupyterlab_claude_code_extension 1.1.3 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/widget.js CHANGED
@@ -836,11 +836,18 @@ export class ClaudeCodeSessionsWidget extends Widget {
836
836
  return;
837
837
  }
838
838
  // JupyterLab's built-in command - spawns a fresh pty with the user's
839
- // shell at the given cwd. No claude, no waiter wrapper, no reuse;
840
- // for when the user wants a plain shell at the project folder.
841
- void this._app.commands.execute('terminal:create-new', {
842
- cwd: this._activeSession.project_path
843
- });
839
+ // shell at the given cwd. The cwd argument is interpreted by the
840
+ // server as a path *relative to the contents manager root*, not an
841
+ // absolute filesystem path - so we translate via _pathUnderRoot,
842
+ // matching the Show in File Browser handling. No claude, no waiter
843
+ // wrapper, no reuse; for when the user wants a plain shell at the
844
+ // project folder.
845
+ const rel = this._pathUnderRoot(this._activeSession.project_path);
846
+ if (rel === null) {
847
+ Notification.warning('Folder is outside the JupyterLab root - cannot open a terminal there.', { autoClose: 4000 });
848
+ return;
849
+ }
850
+ void this._app.commands.execute('terminal:create-new', { cwd: rel });
844
851
  }
845
852
  });
846
853
  this._commands.addCommand('claude-code-sessions:show-in-filebrowser', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyterlab_claude_code_extension",
3
- "version": "1.1.3",
3
+ "version": "1.1.7",
4
4
  "description": "Browse, resume, and manage your Claude Code CLI sessions from a JupyterLab side panel. One click reactivates the right terminal - no duplicate tabs, live remote-control indicator, and favourites for the projects you keep coming back to.",
5
5
  "keywords": [
6
6
  "jupyter",
package/src/widget.ts CHANGED
@@ -977,11 +977,21 @@ export class ClaudeCodeSessionsWidget extends Widget {
977
977
  return;
978
978
  }
979
979
  // JupyterLab's built-in command - spawns a fresh pty with the user's
980
- // shell at the given cwd. No claude, no waiter wrapper, no reuse;
981
- // for when the user wants a plain shell at the project folder.
982
- void this._app.commands.execute('terminal:create-new', {
983
- cwd: this._activeSession.project_path
984
- });
980
+ // shell at the given cwd. The cwd argument is interpreted by the
981
+ // server as a path *relative to the contents manager root*, not an
982
+ // absolute filesystem path - so we translate via _pathUnderRoot,
983
+ // matching the Show in File Browser handling. No claude, no waiter
984
+ // wrapper, no reuse; for when the user wants a plain shell at the
985
+ // project folder.
986
+ const rel = this._pathUnderRoot(this._activeSession.project_path);
987
+ if (rel === null) {
988
+ Notification.warning(
989
+ 'Folder is outside the JupyterLab root - cannot open a terminal there.',
990
+ { autoClose: 4000 }
991
+ );
992
+ return;
993
+ }
994
+ void this._app.commands.execute('terminal:create-new', { cwd: rel });
985
995
  }
986
996
  });
987
997