xshell 1.3.20 → 1.3.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.20",
3
+ "version": "1.3.22",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -88,7 +88,7 @@
88
88
  "tslib": "^2.8.1",
89
89
  "typescript": "^5.9.3",
90
90
  "undici": "^7.16.0",
91
- "webpack": "https://pkg.pr.new/webpack@4adc0d1",
91
+ "webpack": "^5.104.0",
92
92
  "webpack-bundle-analyzer": "^5.1.0",
93
93
  "ws": "^8.18.3"
94
94
  },
@@ -101,7 +101,7 @@
101
101
  "@types/koa": "^3.0.1",
102
102
  "@types/koa-compress": "^4.0.7",
103
103
  "@types/mime-types": "^3.0.1",
104
- "@types/node": "^25.0.2",
104
+ "@types/node": "^25.0.3",
105
105
  "@types/react": "^19.2.7",
106
106
  "@types/tough-cookie": "^4.0.5",
107
107
  "@types/vscode": "^1.107.0",
package/path.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare function extname(path: string): string;
54
54
  /** `/` */
55
55
  export declare const sep = "/";
56
56
  /** The platform-specific file delimiter. ';' or ':'. */
57
- export declare const delimiter: ":" | ";";
57
+ export declare const delimiter: ";" | ":";
58
58
  /** Returns an object from a path string - the opposite of format().
59
59
  @param path path to evaluate.
60
60
  @throws {TypeError} if `path` is not a string. */
@@ -81,7 +81,7 @@ export declare let path: {
81
81
  basename: typeof basename;
82
82
  extname: typeof extname;
83
83
  sep: string;
84
- delimiter: ":" | ";";
84
+ delimiter: ";" | ":";
85
85
  parse: typeof parse;
86
86
  format: typeof format;
87
87
  toNamespacedPath: typeof toNamespacedPath;
package/process.js CHANGED
@@ -3,7 +3,7 @@ import os from 'node:os';
3
3
  import node_sea from 'node:sea';
4
4
  import "./prototype.js";
5
5
  import { fopen } from "./file.js";
6
- import { inspect, DecoderStream, filter_values, check, colored, timeout } from "./utils.js";
6
+ import { inspect, DecoderStream, filter_values, check, colored, timeout, defer } from "./utils.js";
7
7
  export const sea = node_sea.isSea();
8
8
  export const exe_nodejs = process.execPath.fp;
9
9
  export const platform = os.platform();
@@ -155,15 +155,25 @@ function to_subprocess(child, { title, exe, args, command, }) {
155
155
  - title?: 由创建进程的调用者设置的,用于区分、识别、记忆的可选名称 */
156
156
  export async function start(exe, args = [], options = {}) {
157
157
  const { spawn_options, close_all_handles, command } = await prepare_spawn(true, exe, args, options);
158
+ let pspawn = defer();
159
+ let child;
158
160
  try {
159
- let child = to_subprocess(spawn(exe, args, spawn_options), { exe, command, args, title: options.title });
160
- child.unref();
161
- return child;
161
+ child = to_subprocess(spawn(exe, args, spawn_options), { exe, args, command, title: options.title });
162
+ child.once('spawn', () => {
163
+ child.unref();
164
+ pspawn.resolve();
165
+ });
166
+ // 监听 error 事件,处理启动失败的情况(如文件不存在),防止 node.js 进程退出
167
+ child.once('error', error => {
168
+ pspawn.reject(error);
169
+ });
162
170
  }
163
171
  finally {
164
172
  if (close_all_handles)
165
173
  await close_all_handles();
166
174
  }
175
+ await pspawn;
176
+ return child;
167
177
  }
168
178
  export class CallError extends Error {
169
179
  name = 'CallError';