Linux终端字体全白如何解决

本文详细介绍了如何在Bash环境中设置颜色提示,包括复制配置文件、编辑.bashrc、启用颜色提示以及使更改生效的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(1)终端中输入 cp /etc/skel/.bashrc ~/;

(2)打开并修改.bashrc文件: gedit .bashrc;

(3)在.bashrc文件中找“#force_color_prompt=yes”,然后把前面的“#”去掉;

(4)终端中输入source .bashrc让其生效即可。

源自:https://blog.youkuaiyun.com/weixin_39924920/article/details/80456064

出现这种情况可能是因为你的编辑器或终端默认使用了白色背景,而头文件字体颜色默认设置为白色。可以尝试修改编辑器或终端的背景颜色,或者修改头文件字体颜色。如果你使用的是 Visual Studio Code 编辑器,可以在设置中搜索 "workbench.colorCustomizations" 并添加以下内容: ``` "workbench.colorCustomizations": { "editorGutter.background": "#F8F8F8", "editorLineNumber.foreground": "#BBBBBB", "editor.selectionBackground": "#EFEFEF", "editor.inactiveSelectionBackground": "#EFEFEF", "editor.selectionHighlightBorder": "#EFEFEF", "editor.wordHighlightBorder": "#EFEFEF", "editor.wordHighlightStrongBorder": "#EFEFEF", "editor.findMatchBorder": "#EFEFEF", "editor.findMatchHighlightBorder": "#EFEFEF", "editorBracketMatch.border": "#EFEFEF", "editorBracketMatch.background": "#F0F0F0", "editorBracketMatch.highlightBackground": "#F0F0F0", "editorCodeLens.foreground": "#999999", "editorSuggestWidget.background": "#F8F8F8", "editorSuggestWidget.border": "#EFEFEF", "editorSuggestWidget.selectedBackground": "#EFEFEF", "editorOverviewRuler.border": "#F8F8F8", "editorOverviewRuler.findMatchForeground": "#EFEFEF", "editorOverviewRuler.rangeHighlightForeground": "#EFEFEF", "editorOverviewRuler.selectionHighlightForeground": "#EFEFEF", "editorOverviewRuler.wordHighlightForeground": "#EFEFEF", "editorOverviewRuler.wordHighlightStrongForeground": "#EFEFEF", "editorWhitespace.foreground": "#BBBBBB", "editorIndentGuide.background": "#F8F8F8", "editor.lineHighlightBackground": "#F8F8F8", "editor.hoverHighlightBackground": "#F8F8F8", "diffEditor.insertedTextBackground": "#BBFFBB", "diffEditor.removedTextBackground": "#FFBBBB", "editorGroupHeader.tabsBackground": "#F8F8F8", "panel.background": "#F8F8F8", "sideBar.background": "#F8F8F8", "statusBar.background": "#F8F8F8", "tab.activeBackground": "#F8F8F8", "tab.border": "#EFEFEF", "tab.inactiveBackground": "#F8F8F8", "titleBar.activeBackground": "#F8F8F8", "titleBar.inactiveBackground": "#F8F8F8" }, "editor.tokenColorCustomizations": { "textMateRules": [ { "scope": "entity.name.type.class", "settings": { "foreground": "#6C71C4" } }, { "scope": "entity.name.function", "settings": { "foreground": "#268BD2" } }, { "scope": "entity.other.inherited-class", "settings": { "foreground": "#6C71C4" } }, { "scope": "variable.parameter", "settings": { "foreground": "#268BD2" } }, { "scope": "storage.type", "settings": { "foreground": "#6C71C4" } }, { "scope": "support.type", "settings": { "foreground": "#6C71C4" } }, { "scope": "keyword.operator", "settings": { "foreground": "#DC322F" } }, { "scope": "constant.numeric", "settings": { "foreground": "#D33682" } }, { "scope": "constant.language", "settings": { "foreground": "#6C71C4" } }, { "scope": "string", "settings": { "foreground": "#2AA198" } }, { "scope": "comment", "settings": { "foreground": "#657B83" } } ] } ``` 其中,`editor.tokenColorCustomizations` 的部分可以修改头文件字体颜色
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值