Re: Interrpreting modifier codes in /etc/inputrc ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



William Case wrote:
On Thu, 2009-08-06 at 15:29 -0500, Mikkel L. Ellertson wrote:
William Case wrote:

I am lazy - for moving back forth is a line, control of the arrow
keys moves word instead of character. Control of backspace deletes
deletes to the beginning of the word, and control of delete deletes
to end of word.

Mikkel, I would prefer to be lazy too. However, Control+right-arrow
simply produces ";5C" at the cursor on my command line and Control
+left-arrow prints ";5D".

Mikkel is correct. CTRL-left-arrow generates <ESC>[1;5C (<ESC> meaning "escape" or the "\e" from the previous posts), CTRL-right-arrow produces
<ESC>[1;5D.  If you're curios, run "showkey -a" from a command prompt
and press those sequences:

[root@prophead ~]# showkey -a

Press any keys - Ctrl-D will terminate this program

(Press CTRL-left-arrow)
^[[1;5D 	 27 0033 0x1b  ("<ESC>" in decimal, octal and hex)
 	 91 0133 0x5b (the "[" in dec, octal, and hex)
 	 49 0061 0x31 (the "1")
 	 59 0073 0x3b (the ";")
 	 53 0065 0x35 (the "5")
 	 68 0104 0x44 (the "D")

(Press CTRL-right-arrow)
^[[1;5C 	 27 0033 0x1b (escape)
 	 91 0133 0x5b ("[")
 	 49 0061 0x31 ("1")
 	 59 0073 0x3b (";")
 	 53 0065 0x35 ("5")
 	 67 0103 0x43 ("C")

(Press CTRL-D to exit)

As to bash just displaying the ";5C" or whatever, you have to have data
on the command line for it to the sequences to operate on.  If you're
just at a prompt and you hit one of those sequences, there's nothing to
act on and you'll probably rewarded with a beep and a display of the
remainder of the key sequence.

Try putting "the quick brown fox" after a command prompt, then use CTRL-left-arrow and watch the cursor move back by words.

----------------------------------------------------------------------
- Rick Stevens, Systems Engineer                      ricks@xxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-               The Theory of Rapitivity: E=MC Hammer                -
-                                  -- Glenn Marcus (via TopFive.com) -
----------------------------------------------------------------------

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux