在 PuTTY 中从批处理文件自动执行的命令输出的布局被破坏

Layout of command output executed automatically in PuTTY from a batch file is broken

我已经按照这个问题使用我的用户名和密码为 运行 PuTTY 构建了一个批处理文件: How to run a command file in PuTTY using automatic login in a command prompt?


@echo off
START putty.exe -ssh [domain] -l [username] -pw [password] -m code.txt
@echo

并且 PuTTY 将尝试 运行 code.txt 文件,其中包含以下代码:

HResults -p -e "???" sil -e "???" sp -L labels/test lib/words3 results/*.rec
read

它将显示一个矩阵。我尝试 运行 批处理文件,它能够打开 PuTTY、登录和 运行 文本文件中的命令。但是 PuTTY 终端的输出是一团糟。当我手动执行这些操作时,输出布局很好。这是否意味着缺少某种设置?批处理文件将更改另一个应用程序的输出没有任何意义......谢谢

-m 开关表示非交互式会话。而手动登录时,默认使用交互模式。

它可能会从根本上影响某些应用程序的输出。

尝试使用 -t switch:

强制进入交互模式
START putty.exe -ssh [domain] -t -l [username] -pw [password] -m code.txt