0

All of a sudden my backslash key doesn't work in terminal. It works in other programs, and I have checked the preferences in the keyboard section of the terminal and it is not assigned to a special character. I have also tried copying and pasting a backslash but it will not appear. Any time I try to type one, I get a "not allowed" noise (sorry, I don't know how to describe that). I even tried restarting my computer.

The contents of in .inputrc file are:

"\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
16
  • Could you share the contents of your ~/.inputrc file?
    – marshki
    Oct 16, 2017 at 16:18
  • I have edited the original question to add the contents!
    – Lisa
    Oct 16, 2017 at 16:28
  • 1
    I think the problem is with this line: "\"": self-insert. There's an extra " there. Remove the excess quote and you should be able to use the `\` again.
    – marshki
    Oct 16, 2017 at 17:41
  • That's line 170 in vi for me.
    – marshki
    Oct 16, 2017 at 17:47
  • 1
    @marshki I'm pretty sure that line's correct; it's binding the " character to self-insert, but in order to appear in a double-quoted string the double-quote itself must be escaped. On the other hand, I don't see any binding for backslash itself (it would look like "\\": self-insert). It shouldn't be needed in .inputrc (it should be bound by default), but maybe it isn't for some reason? Try bind -p, and see if it lists that. Oct 17, 2017 at 1:16

1 Answer 1

1

For future reference, here are the steps one could take to troubleshoot similar problems. From a terminal:

  • bind -P lists current bindings
  • bind -P | grep '\\\\' to sort through the list and look for a particular character, in this case the backslash \
  • bash --noediting to enter a shell without the .inputrc file binding. If the command works in this mode, it's most likely a problem with a bad binding.

You can edit .inputrc with a text editor if you are clear on what the bad biding is.

Bind also allows you to free a key binding: bind -r keyseqbut if the key doesn't work, it's not obvious how this could work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .