突然间,我的反斜杠键在终端中不起作用了。它在其他程序中起作用,并且我检查了终端键盘部分的首选项,发现它没有分配给特殊字符。我还尝试复制和粘贴反斜杠,但它不会出现。每当我尝试输入一个反斜杠时,我都会听到“不允许”的声音(抱歉,我不知道该如何描述)。我甚至尝试重新启动我的电脑。
.inputrc文件的内容为:
"\C-g": abort
"\C-x\C-g": abort
"\e\C-g": abort
"\C-j": accept-line
"\C-m": accept-line
\# alias-expand-line (not bound)
\# arrow-key-prefix (not bound)
\# backward-byte (not bound)
"\C-b": backward-char
"\eOD": backward-char
"\e[D": backward-char
"\C-h": backward-delete-char
"\C-?": backward-delete-char
"\C-x\C-?": backward-kill-line
"\e\C-h": backward-kill-word
"\e\C-?": backward-kill-word
"\eb": backward-word
"\e<": beginning-of-history
"\C-a": beginning-of-line
"\eOH": beginning-of-line
"\e[H": beginning-of-line
"\C-xe": call-last-kbd-macro
"\ec": capitalize-word
"\C-]": character-search
"\e\C-]": character-search-backward
"\C-l": clear-screen
"\C-i": complete
"\e\e": complete
"\e!": complete-command
"\e/": complete-filename
"\e@": complete-hostname
"\e{": complete-into-braces
"\e~": complete-username
"\e$": complete-variable
\# copy-backward-word (not bound)
\# copy-forward-word (not bound)
\# copy-region-as-kill (not bound)
"\C-d": delete-char
"\e[3~": delete-char
\# delete-char-or-list (not bound)
"\e\\": delete-horizontal-space
"\e-": digit-argument
"\e0": digit-argument
"\e1": digit-argument
"\e2": digit-argument
"\e3": digit-argument
"\e4": digit-argument
"\e5": digit-argument
"\e6": digit-argument
"\e7": digit-argument
"\e8": digit-argument
"\e9": digit-argument
"\C-x\C-v": display-shell-version
"\C-xA": do-lowercase-version
"\C-xB": do-lowercase-version
"\C-xC": do-lowercase-version
"\C-xD": do-lowercase-version
"\C-xE": do-lowercase-version
"\C-xF": do-lowercase-version
"\C-xG": do-lowercase-version
"\C-xH": do-lowercase-version
"\C-xI": do-lowercase-version
"\C-xJ": do-lowercase-version
"\C-xK": do-lowercase-version
"\C-xL": do-lowercase-version
"\C-xM": do-lowercase-version
"\C-xN": do-lowercase-version
"\C-xO": do-lowercase-version
"\C-xP": do-lowercase-version
"\C-xQ": do-lowercase-version
"\C-xR": do-lowercase-version
"\C-xS": do-lowercase-version
"\C-xT": do-lowercase-version
"\C-xU": do-lowercase-version
"\C-xV": do-lowercase-version
"\C-xW": do-lowercase-version
"\C-xX": do-lowercase-version
"\C-xY": do-lowercase-version
"\C-xZ": do-lowercase-version
"\eA": do-lowercase-version
"\eB": do-lowercase-version
"\eC": do-lowercase-version
"\eD": do-lowercase-version
"\eE": do-lowercase-version
"\eF": do-lowercase-version
"\eG": do-lowercase-version
"\eH": do-lowercase-version
"\eI": do-lowercase-version
"\eJ": do-lowercase-version
"\eK": do-lowercase-version
"\eL": do-lowercase-version
"\eM": do-lowercase-version
"\eN": do-lowercase-version
"\eP": do-lowercase-version
"\eQ": do-lowercase-version
"\eR": do-lowercase-version
"\eS": do-lowercase-version
"\eT": do-lowercase-version
"\eU": do-lowercase-version
"\eV": do-lowercase-version
"\eW": do-lowercase-version
"\eX": do-lowercase-version
"\eY": do-lowercase-version
"\eZ": do-lowercase-version
"\el": downcase-word
\# dump-functions (not bound)
\# dump-macros (not bound)
\# dump-variables (not bound)
"\e\C-i": dynamic-complete-history
"\C-x\C-e": edit-and-execute-command
\# emacs-editing-mode (not bound)
"\C-x)": end-kbd-macro
"\e>": end-of-history
"\C-e": end-of-line
"\eOF": end-of-line
"\e[F": end-of-line
"\C-x\C-x": exchange-point-and-mark
\# forward-backward-delete-char (not bound)
\# forward-byte (not bound)
"\C-f": forward-char
"\eOC": forward-char
"\e[C": forward-char
"\C-s": forward-search-history
"\ef": forward-word
"\eg": glob-complete-word
"\C-x*": glob-expand-word
"\C-xg": glob-list-expansions
\# history-and-alias-expand-line (not bound)
"\e^": history-expand-line
\# history-search-backward (not bound)
"\\": history-search-forward
"\e#": insert-comment
"\e*": insert-completions
"\e.": insert-last-argument
"\e_": insert-last-argument
"\C-k": kill-line
\# kill-region (not bound)
\# kill-whole-line (not bound)
"\ed": kill-word
\# magic-space (not bound)
\# menu-complete (not bound)
"\C-n": next-history
"\eOB": next-history
"\e[B": next-history
"\en": non-incremental-forward-search-history
\# non-incremental-forward-search-history-again (not bound)
"\ep": non-incremental-reverse-search-history
\# non-incremental-reverse-search-history-again (not bound)
"\C-o": operate-and-get-next
\# overwrite-mode (not bound)
"\C-x!": possible-command-completions
"\e=": possible-completions
"\e?": possible-completions
"\C-x/": possible-filename-completions
"\C-x@": possible-hostname-completions
"\C-x~": possible-username-completions
"\C-x$": possible-variable-completions
"\C-p": previous-history
"\eOA": previous-history
"\e[A": previous-history
"\C-q": quoted-insert
"\C-v": quoted-insert
"\C-x\C-r": re-read-init-file
\# redraw-current-line (not bound)
"\C-r": reverse-search-history
"\e\C-r": revert-line
"\er": revert-line
" ": self-insert
"!": self-insert
"\"": self-insert
"#": self-insert
"$": self-insert
"%": self-insert
"&": self-insert
"'": self-insert
"(": self-insert
")": self-insert
"*": self-insert
"+": self-insert
",": self-insert
"-": self-insert
".": self-insert
"/": self-insert
"0": self-insert
"1": self-insert
"2": self-insert
"3": self-insert
"4": self-insert
"5": self-insert
"6": self-insert
"7": self-insert
"8": self-insert
"9": self-insert
":": self-insert
";": self-insert
"<": self-insert
"=": self-insert
">": self-insert
"?": self-insert
"@": self-insert
"A": self-insert
"B": self-insert
"C": self-insert
"D": self-insert
"E": self-insert
"F": self-insert
"G": self-insert
"H": self-insert
"I": self-insert
"J": self-insert
"K": self-insert
"L": self-insert
"M": self-insert
"N": self-insert
"O": self-insert
"P": self-insert
"Q": self-insert
"R": self-insert
"S": self-insert
"T": self-insert
"U": self-insert
"V": self-insert
"W": self-insert
"X": self-insert
"Y": self-insert
"Z": self-insert
"[": self-insert
"]": self-insert
"^": self-insert
"_": self-insert
"`": self-insert
"a": self-insert
"b": self-insert
"c": self-insert
"d": self-insert
"e": self-insert
"f": self-insert
"g": self-insert
"h": self-insert
"i": self-insert
"j": self-insert
"k": self-insert
"l": self-insert
"m": self-insert
"n": self-insert
"o": self-insert
"p": self-insert
"q": self-insert
"r": self-insert
"s": self-insert
"t": self-insert
"u": self-insert
"v": self-insert
"w": self-insert
"x": self-insert
"y": self-insert
"z": self-insert
"{": self-insert
"|": self-insert
"}": self-insert
"~": self-insert
"\200": self-insert
"\201": self-insert
"\202": self-insert
"\203": self-insert
"\204": self-insert
"\205": self-insert
"\206": self-insert
"\207": self-insert
"\210": self-insert
"\211": self-insert
"\212": self-insert
"\213": self-insert
"\214": self-insert
"\215": self-insert
"\216": self-insert
"\217": self-insert
"\220": self-insert
"\221": self-insert
"\222": self-insert
"\223": self-insert
"\224": self-insert
"\225": self-insert
"\226": self-insert
"\227": self-insert
"\230": self-insert
"\231": self-insert
"\232": self-insert
"\233": self-insert
"\234": self-insert
"\235": self-insert
"\236": self-insert
"\237": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"?": self-insert
"\C-@": set-mark
"\e ": set-mark
"\e\C-e": shell-expand-line
"\C-x(": start-kbd-macro
\# tab-insert (not bound)
"\e&": tilde-expand
"\C-t": transpose-chars
"\et": transpose-words
\# tty-status (not bound)
"\C-x\C-u": undo
"\C-_": undo
\# universal-argument (not bound)
\# unix-filename-rubout (not bound)
"\C-u": unix-line-discard
"\C-w": unix-word-rubout
"\eu": upcase-word
\# vi-append-eol (not bound)
\# vi-append-mode (not bound)
\# vi-arg-digit (not bound)
\# vi-bWord (not bound)
\# vi-back-to-indent (not bound)
\# vi-bword (not bound)
\# vi-change-case (not bound)
\# vi-change-char (not bound)
\# vi-change-to (not bound)
\# vi-char-search (not bound)
\# vi-column (not bound)
\# vi-complete (not bound)
\# vi-delete (not bound)
\# vi-delete-to (not bound)
\# vi-eWord (not bound)
\# vi-editing-mode (not bound)
\# vi-end-word (not bound)
\# vi-eof-maybe (not bound)
\# vi-eword (not bound)
\# vi-fWord (not bound)
\# vi-fetch-history (not bound)
\# vi-first-print (not bound)
\# vi-fword (not bound)
\# vi-goto-mark (not bound)
\# vi-insert-beg (not bound)
\# vi-insertion-mode (not bound)
\# vi-match (not bound)
\# vi-movement-mode (not bound)
\# vi-next-word (not bound)
\# vi-overstrike (not bound)
\# vi-overstrike-delete (not bound)
\# vi-prev-word (not bound)
\# vi-put (not bound)
\# vi-redo (not bound)
\# vi-replace (not bound)
\# vi-rubout (not bound)
\# vi-search (not bound)
\# vi-search-again (not bound)
\# vi-set-mark (not bound)
\# vi-subst (not bound)
\# vi-tilde-expand (not bound)
\# vi-yank-arg (not bound)
\# vi-yank-to (not bound)
"\C-y": yank
"\e.": yank-last-arg
"\e_": yank-last-arg
"\e\C-y": yank-nth-arg
"\ey": yank-pop
答案1
供将来参考,以下是解决类似问题可以采取的步骤。从终端:
bind -P
列出当前绑定bind -P | grep '\\\\'
对列表进行排序并查找特定字符,在本例中为反斜杠\
bash --noediting
进入没有.inputrc
文件绑定的 shell。如果命令在此模式下有效,则很可能是绑定错误造成的问题。
.inputrc
如果您清楚什么是不良投标,则 可以使用文本编辑器进行编辑。
Bind 还允许您释放键绑定:
bind -r keyseq
但如果该键不起作用,则其如何起作用就不明显了。