perf: ssh 增加禁止-i参数提示

This commit is contained in:
xiaojunnuo
2025-10-24 22:48:32 +08:00
parent 7ebd8f6bf5
commit 3a8931feef
2 changed files with 6 additions and 1 deletions

View File

@@ -188,6 +188,11 @@ export class AsyncSsh2Client {
// script += "\r\nexit\r\n";
// //保证windows下正常退出
// }
if (script.includes(" -i ")) {
this.logger.warn("不支持交互式命令,请不要使用-i参数");
}
return safePromise((resolve, reject) => {
this.logger.info(`执行命令:[${this.connConf.host}][exec]: \n` + script);
// pty 伪终端window下的输出会带上conhost.exe之类的多余的字符串影响返回结果判断