windows - 使用 Windows 终端的 Cmder 颜色错误

标签 windows terminal conemu cmder

我正在尝试在 Windows 终端中使用 Cmder。我尝试遵循 this指南,我按照它说的做了一切。

但是,有一个小问题。无论我做什么,提示背景颜色都不会改变,它保持黑色。

enter image description here

我无法弄清楚这个问题。有什么建议吗?

最佳答案

在同一篇文章的评论部分

I ran into this issue as well and was able to get it working. In your "%cmder_root%\config" directory, create a file called "my_prompt.lua" and add the following to it:

function my_prompt_filter()
  cwd = clink.get_cwd()
  prompt = "\x1b[1;32;49m{cwd} {git}{hg}{svn} \n\x1b[1;39;49m{lamb} \x1b[0m"
  new_value = string.gsub(prompt, "{cwd}", cwd)
  clink.prompt.value = string.gsub(new_value, "{lamb}", "λ")
  end
  clink.prompt.register_filter(my_prompt_filter, 1)

感谢Eric Grandt

关于windows - 使用 Windows 终端的 Cmder 颜色错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67541540/

相关文章:

windows - event.getFile().getFileName() 在带有 PrimeFaces 3.5 的 JSF2.0 中返回具有完整路径的文件名

java - 我可以在不安装 Ask 工具栏的情况下静默安装 Java JRE 吗?

Mac 上的 github 安装

objective-c - Mac OS X 的命令行应用程序

linux - 如何在终端 lisp 方案解释​​器中导航文本?

windows - 如何将Windows目录(cmd)中当前目录下的所有内容输入可执行文件?

c - `.eh_frame' 和 collect2.exe : error: ld returned 1 exit status when compiling with MinGW 中的错误重定位地址

windows-subsystem-for-linux - ConEmu + WSL : Open new console in current tab directory

environment-variables - 锥体和console2模拟器未获取新的路径变量

git-bash - ConEmu with Git Bash - 在标签栏中显示文件夹