From ca7b2a5e981f40c43a8d7cf6dad16bd8f6562832 Mon Sep 17 00:00:00 2001 From: Suwings Date: Sat, 16 Jul 2022 17:21:53 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20=E4=BF=AE=E6=AD=A3=E6=9B=B4=E7=B2=BE?= =?UTF-8?q?=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entity/instance/instance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entity/instance/instance.ts b/src/entity/instance/instance.ts index c0f2f36..9543353 100644 --- a/src/entity/instance/instance.ts +++ b/src/entity/instance/instance.ts @@ -124,7 +124,7 @@ export default class Instance extends EventEmitter { // 若终端类型改变,则必须重置预设命令 if (cfg?.terminalOption?.pty != null && cfg?.terminalOption?.pty !== this.config.terminalOption.pty) { if (this.status() != Instance.STATUS_STOP) throw new Error("正在运行时无法修改PTY模式"); - if (!fs.existsSync(PTY_PATH)) + if (!fs.existsSync(PTY_PATH) && cfg?.terminalOption?.pty === true) throw new Error(`无法启用仿真终端,因为 ${PTY_PATH} 附属程序不存在,您可以联系管理员重启 Daemon 程序得以重新安装(仅 Linux)`); configureEntityParams(this.config.terminalOption, cfg.terminalOption, "pty", Boolean); this.forceExec(new FunctionDispatcher());