key binding table.

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
rayandrews

key binding table.

Post by rayandrews »

Hi All,

I just spent the whole morning looking for some complete table showing me what the keybindings are for the entire keyboard as one might use them in /etc/inputrc. There are a zillion specific examples but no complete list.

\e[A == UpArrow
\e[1~ == Home
etc.

Can anyone point me to a complete list? If I'm going to start playing with inputrc, I want to know what all my options are. It seems hard to believe that this information would not be easy to find.

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29508
Joined: Wed Jul 06, 2011 3:58 am

Re: key binding table.

Post by xenopeek »

For information on how to edit the inputrc file, see info bash under the Readline Initialization section. info readline also has examples of the keybindings. That gives you all the info to make keybindings for Ctrl or Meta key + any printable key. For non-printable keys, you need to use the escape character and the escape sequence. Some examples are given in the info pages, other escape sequences you can find out with the read command as detailed here: https://code.google.com/p/iterm2/wiki/K ... xploration
Image
rayandrews

Re: key binding table.

Post by rayandrews »

xenopeek wrote:For information on how to edit the inputrc file, see info bash under the Readline Initialization section. info readline also has examples of the keybindings. That gives you all the info to make keybindings for Ctrl or Meta key + any printable key. For non-printable keys, you need to use the escape character and the escape sequence. Some examples are given in the info pages, other escape sequences you can find out with the read command as detailed here: https://code.google.com/p/iterm2/wiki/K ... xploration
Vincent,

Thanks, some pretty detailed information there. But still no complete table of all possible keys available for binding.
User avatar
xenopeek
Level 25
Level 25
Posts: 29508
Joined: Wed Jul 06, 2011 3:58 am

Re: key binding table.

Post by xenopeek »

rayandrews wrote:But still no complete table of all possible keys available for binding.
Yeah, I know. Couldn't find it either. But with the read command and the other info, you can get all the info. A table of all the keybindings won't be there until somebody makes it (hint hint :wink:).
Image
rayandrews

Re: key binding table.

Post by rayandrews »

xenopeek wrote:
rayandrews wrote:But still no complete table of all possible keys available for binding.
Yeah, I know. Couldn't find it either. But with the read command and the other info, you can get all the info. A table of all the keybindings won't be there until somebody makes it (hint hint :wink:).
Ok, thanks Vincent, I'll stop looking then. I'm still adapting to linux culture, it's strange how something so powerful can still be so lacking in some of the most basic conviniences that one takes for granted even in DOS. For example, I'm still trying to get bash to have even the simplest of the many command line editing and history recall features that 4DOS/4NT has.
User avatar
xenopeek
Level 25
Level 25
Posts: 29508
Joined: Wed Jul 06, 2011 3:58 am

Re: key binding table.

Post by xenopeek »

Reportedly, zsh is more like 4DOS than bash. The default shell on Linux Mint is bash, but you can also install zsh (sudo apt-get install zsh). Might be worth having a look. More info here: http://www.zsh.org/
You can change what you default shell is in Menu > Control Center > Users and Groups, Advanced Settings button, Advanced tab, change the Shell setting to zsh.
Image
rayandrews

Re: key binding table.

Post by rayandrews »

xenopeek wrote:Reportedly, zsh is more like 4DOS than bash. The default shell on Linux Mint is bash, but you can also install zsh (sudo apt-get install zsh). Might be worth having a look. More info here: http://www.zsh.org/
You can change what you default shell is in Menu > Control Center > Users and Groups, Advanced Settings button, Advanced tab, change the Shell setting to zsh.
Yeah, I've been considering a switch to zsh, but I wanted to learn at least a bit of bash so that I'd be able to make an informed comparison. So little time, so much to know ;-)
ChickenPie4Tea

Re: key binding table.

Post by ChickenPie4Tea »

well nearly all the commands are the same - so you can use them in zsh - it's just that zsh has extras
Locked

Return to “Scripts & Bash”