@zhangfengshun/dsh-remote-ssh 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -18,7 +18,7 @@ import { join } from "node:path";
18
18
  /** Plugin identity for cordis.yml rows. */
19
19
  const name = "@zhangfengshun/dsh-remote-ssh";
20
20
  /** Services required before mounting. */
21
- const inject = ["webServer", "subprocess", "tools", "sessions", "webRuntime"];
21
+ const inject = ["webServer", "subprocess", "tools"];
22
22
  /** Composition config schema(本插件暂无配置项)。 */
23
23
  const Config = z.object({});
24
24
 
@@ -1560,8 +1560,9 @@ function apply(ctx, config) {
1560
1560
  // 获取会话 cwd
1561
1561
  const sessionId = payload && payload.sessionId;
1562
1562
  let sessionCwd = payload && payload.cwd;
1563
- if ((!sessionCwd || sessionCwd === "") && sessionId && ctx.sessions) {
1564
- const session = ctx.sessions.get(sessionId);
1563
+ if ((!sessionCwd || sessionCwd === "") && sessionId) {
1564
+ const sessions = ctx.get("sessions");
1565
+ const session = sessions ? sessions.get(sessionId) : null;
1565
1566
  sessionCwd = session && session.header && session.header.cwd;
1566
1567
  }
1567
1568
  // 如果 sessionCwd 还是空,尝试用 payload.path 的父目录(文件操作时 path 是文件路径)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "DSH web plugin: VSCode Remote-SSH-like remote development (SSH to supercomputers/servers, remote workspace, file explorer, integrated terminal), integrated with dsh-better-sidebar and DSH settings.",
5
5
  "keywords": [
6
6
  "dsh",