@lvce-editor/pty-host 7.0.0 → 7.1.0
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/dist/ptyHostMain.js +9 -2
- package/package.json +1 -1
package/dist/ptyHostMain.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { fileURLToPath } from 'node:url';
|
|
1
2
|
import { Console } from 'node:console';
|
|
2
3
|
import { createWriteStream, readFileSync } from 'node:fs';
|
|
3
4
|
import { tmpdir } from 'node:os';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { Buffer } from 'node:buffer';
|
|
6
6
|
|
|
7
7
|
class CommandNotFoundError extends Error {
|
|
@@ -1358,6 +1358,12 @@ class Pty extends EventTarget {
|
|
|
1358
1358
|
this.pty.write(data);
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
+
const toPath = pathOrUri => {
|
|
1362
|
+
if (pathOrUri && pathOrUri.startsWith('file://')) {
|
|
1363
|
+
return fileURLToPath(pathOrUri).toString();
|
|
1364
|
+
}
|
|
1365
|
+
return pathOrUri;
|
|
1366
|
+
};
|
|
1361
1367
|
|
|
1362
1368
|
/**
|
|
1363
1369
|
*
|
|
@@ -1376,8 +1382,9 @@ const create$1 = async ({
|
|
|
1376
1382
|
const {
|
|
1377
1383
|
spawn
|
|
1378
1384
|
} = await import('node-pty');
|
|
1385
|
+
const cwdPath = toPath(cwd);
|
|
1379
1386
|
const pty = spawn(command, args, {
|
|
1380
|
-
cwd,
|
|
1387
|
+
cwd: cwdPath,
|
|
1381
1388
|
encoding: null
|
|
1382
1389
|
// cols: 10,
|
|
1383
1390
|
// rows: 10,
|