我使用我的~/.Xresources文件配置URxvt,在向该文件添加注释之后,它似乎导致xrdb停止接受该文件。
我现在明白了:
xrdb: colon missing on line 3, ignoring line
xrdb: colon missing on line 5, ignoring line
xrdb: colon missing on line 7, ignoring line
xrdb: colon missing on line 9, ignoring line
xrdb: colon missing on line 11, ignoring line
xrdb: colon missing on line 13, ignoring line
xrdb: colon missing on line 14, ignoring line
xrdb: colon missing on line 16, ignoring line
xrdb: colon missing on line 18, ignoring line
xrdb: colon missing on line 20, ignoring line
xrdb: colon missing on line 22, ignoring line
xrdb: colon missing on line 24, ignoring line
xrdb: colon missing on line 26, ignoring line奇怪的是,这些并不都是评论行。有的是空白的,有的是实际的配置行。这也是奇怪的,它似乎切断了一个特定的点,文件是42行。
我的~/.Xresources文件是
! === URvxt Configuration Section ===:
! Turn off the scrollbar.
URxvt*scrollBar: true
! Set an external border of 4 pixels.
URxvt*externalBorder: 4
! Make the pointer blink.
URxvt*pointerBlink: true
! Save as many lines as zsh.
URxvt*saveLines: 100000
! Set font to Terminus
URxvt*font: xft:Terminus:size=10
! === URxvt Colorscheme Section ===
! Set the foreground (text) to pure white.
URxvt.foreground: #FFFFFF
! Set the background to a grey-black.
URxvt.background: #151515
! Color 0 - Primary Background
URxvt.color0: #151515
! Color 1 - Primary Foreground
URxvt.color1: #FFFFFF
! Color 2 - Secondary Background
URxvt.color2: #1F1F1F
! Color 3 - Secondary Foreground
URvxt.color3: #787878
! === END URxvt Colorscheme Section
! === END URvxt Configuration Section ===有人知道我为什么会犯这些错误吗?
发布于 2017-12-08 15:09:50
看起来,xrdb希望评论总是以'!‘开头。在第一栏中。
文档对此并不完全清楚:“如果一行以!(感叹号)开头,则它被视为注释,而行的其余部分则被忽略。”
发布于 2022-11-02 05:47:08
老职位,但对于那些经历同样的事情,以下是答案:
在Xresources文件中的注释分隔符( '!‘)前面有空格。这是一个很大的不-不,是你的问题的原因。这也将发生在直接交互w/ XServer的鑫in、Xdefaults等文件中。X-Files不喜欢注释分隔符@行的开头(或结尾)前面的空格。如果您将代码复制并粘贴到文件中,则需要进行一些清理工作。白色的空间->不好的地方。
发布于 2022-11-02 08:28:14
ResourceLine = Comment | IncludeFile | ResourceSpec | <empty line>
Comment = "!" {<any character except null or newline>}
IncludeFile = "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace
FileName = <valid filename for operating system>
ResourceSpec = WhiteSpace ResourceName WhiteSpace ":" WhiteSpace Value
ResourceName = [Binding] {Component Binding} ComponentName
Binding = "." | "*"
WhiteSpace = {<space> | <horizontal tab>}
Component = "?" | ComponentName
ComponentName = NameChar {NameChar}
NameChar = "a"-"z" | "A"-"Z" | "0"-"9" | "_" | "-"
Value = {<any character except null or unescaped newline>}Comment的语法在"!“之前不包括任何空格。由于它与此不匹配,其次是ResourceSpec,这不是OP的意图。
https://unix.stackexchange.com/questions/409750
复制相似问题