VS Code 集成终端上出现意外的 ANSI 转义码

问题描述 投票:0回答:1

我的 Visual Studio Code 集成终端在每个命令行上显示一些转义的 ANSI 代码:

\x1b7\x1b[38\x3b2\x3b122\x3b122\x3b122m ❮ \x1b[0m\x1b[38\x3b2\x3b159\x3b211\x3b86m

enter image description here

这些是与终端相关的当前设置:

"terminal.integrated.fontSize": 12,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.enableImages": true,
"terminal.integrated.persistentSessionReviveProcess": "never"

我还通过 PowerShell 用户配置文件配置了 Oh My Posh 19.24.2:

oh-my-posh init pwsh --config "C:\Users\sergi\AppData\Local\Programs\oh-my-posh\themes\slimfat.omp.json" | Invoke-Expression

如何修复?

powershell visual-studio-code oh-my-posh
1个回答
0
投票

您需要在 vscode 中禁用 shell 集成。如果您想启用 shell 集成,您可以使用

"shell_integration": true
在 oh-my-posh 配置中进行操作。

© www.soinside.com 2019 - 2024. All rights reserved.