直接换成 CMD(推荐,彻底看不到 PS,还能避开 npm 脚本权限报错)

1. 设置 VS Code 默认终端为 Command Prompt

  1. VS Code 快捷键 Ctrl + Shift + P
  2. 输入:Terminal: Select Default Profile
  3. 选择 Command Prompt(底层是 C:\WINDOWS\System32\cmd.exe)
  4. 关闭现有终端,重新打开,前缀变成纯路径 E:\zfq\agent-project\openclaw>,不再显示 PS

CMD 提示符精简(可选,只保留 >)

  1. 按 Ctrl+, 打开设置,右上角打开 settings.json
  2. 添加配置:

json

"terminal.integrated.profiles.windows": {
  "Command Prompt": {
    "path": "${env:windir}\\System32\\cmd.exe",
    "args": ["/k", "prompt $G"]
  }
},
"terminal.integrated.defaultProfile.windows": "Command Prompt"

保存后重启终端,提示符只剩 >,无路径。

更多推荐