@Benin 在 Codex 在 Windows 调用 PowerShell7 + StarShip 报错问题解决 中发帖
因为个人在 Windows Terminal、PowerShell 7、StarShip 环境使用 Codex
当 Codex 在调用命令的时候会出现这些问题:
[image]
原因是 Codex 调用命令的时候会使用用户的 profile,但又加了 TERM=dumb 环境变量
这个变量的作用是告诉终端别搞花样输出,老实输出命令结果。
但 starship 作为花样输出的工具碰到这个变量会报个错,我们给 profile 加个变量即可解决
$ENV:STARSHIP_CONFIG = "change\your\starship.toml"
if ($env:TERM -ne 'dumb') {
Invoke-Expression (&starship init powershell)
}
这样不影响正常使用,也让 Codex 可以减少上下文幻觉了。
[image...