14

When I type Control and any of the arrow keys in any terminal (gnome-terminal, as well as terminator), I get this (or something like it).

It happens when I use openbox as well, so it's not a compiz issue. And it's only in terminal programs, never in a GUI app (such as Firefox, Chrom(ium)e, or Empathy).

jrg
  • 60,611
  • What were you expecting Ctrl+arrows to do in a terminal window? – Colin Watson Jul 18 '11 at 10:43
  • what keyboard do you use and what is your keyboard settings? – Dirk Hartzer Waldeck Jul 18 '11 at 10:44
  • @colin ctrl+arrow jumps to the end of the next or previous word – Dirk Hartzer Waldeck Jul 18 '11 at 10:45
  • @Dirk I use the built-in keyboard on my asus 1001p with the 105-key-keyboard settings. Didn't have this issue until last week either. – jrg Jul 18 '11 at 10:49
  • @James, weird, I had some issue with my keyboard when I selected a different layout from US, but if these settings has worked before you should probably check for a bug report on Launchpad – Dirk Hartzer Waldeck Jul 18 '11 at 11:01
  • @Dirk, that was my first place to look. Haven't found anything yet. – jrg Jul 18 '11 at 11:06
  • @Dirk, that may be true in many applications, but I think it's most likely defined in some graphical widget library, and I don't see it defined in the bash(1) documentation, so I wouldn't assume that it works in the shell. ESC f and ESC b move forward and backward by words in the shell; bash(1)'s documentation on readline explains how to bind different keystrokes if you prefer. – Colin Watson Jul 20 '11 at 17:02
  • @Colin, it works by default in gnome-terminal and konsole on both Ubuntu and Fedora so if it's not working for James, I figure it's a bug – Dirk Hartzer Waldeck Jul 20 '11 at 17:11
  • @Dirk @Colin, I'm starting to agree that it's a bug. Going to remove gnome-terminal and see if I can get it to reset itself somehow. – jrg Jul 20 '11 at 17:23

2 Answers2

19

What is in your ~/.inputrc and /etc/inputrc? The minimum to get those keys working is, I think:

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

If you have these in /etc/inputrc, the file needs to be included from ~/.inputrc, so check that it has the following line:

$include /etc/inputrc
taneli
  • 2,629
  • I'm wondering why this is happening in kubuntu 12.10. It's never happened in a previous version before. Is this a bug that needs reporting? – naught101 Nov 20 '12 at 03:36
  • 1
    I had this issue and your comment about including the file in the local ~/.inputrc solved it. It had appeared because I had created and local inputrc without incluing the global one... – Louis Gagnon May 28 '19 at 08:01
0

You may be using the wrong shell. Try to change the shell into bash by commanding

chsh -s /bin/bash $(whoami)

Do not use sudo or run as root. You may be prompted to enter the password. Reboot after you change the shell.

h22
  • 196