forked from mirror/MCSM-Daemon
Feat: Cross-platform pty
This commit is contained in:
parent
24815444d0
commit
08acf31894
@ -3,7 +3,9 @@
|
||||
import os from "os";
|
||||
import path from "path";
|
||||
|
||||
const PTY_PATH = path.normalize(path.join(process.cwd(), "lib", os.platform() === "win32" ? "pty.exe" : "pty"));
|
||||
const ptyName = `pty_${os.platform()}_${os.arch()}${os.platform() === "win32" ? ".exe" : ""}`;
|
||||
|
||||
const PTY_PATH = path.normalize(path.join(process.cwd(), "lib", ptyName));
|
||||
|
||||
const FILENAME_BLACKLIST = ["\\", "/", ".", "'", '"', "?", "*", "<", ">"];
|
||||
|
||||
|
@ -104,11 +104,6 @@ export default class PtyStartCommand extends InstanceCommand {
|
||||
checkPtyEnv = false;
|
||||
}
|
||||
|
||||
if ((os.platform() !== "linux" && os.platform() !== "win32") || os.arch() !== "x64") {
|
||||
instance.println("ERROR", $t("pty_start.notSupportPty"));
|
||||
checkPtyEnv = false;
|
||||
}
|
||||
|
||||
if (checkPtyEnv === false) {
|
||||
// Close the PTY type, reconfigure the instance function group, and restart the instance
|
||||
instance.config.terminalOption.pty = false;
|
||||
|
Loading…
Reference in New Issue
Block a user