Question

I connect to AIX 5.3 through ssh from Centos 6. Shells on AIX and Centos are bash. When I press "Home", "End", "PgUp", "PgDn" in shell, bash outputs tilde (~) and cursor is not moving to end or begin of string. How can I get these buttons work properly?

Was it helpful?

Solution

Try putting this in your Readline initialization file (default ~/.inputrc):

"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[7~": beginning-of-line
"\e[8~": end-of-line

If you want to figure out what characters are being generated by a key sequence, one way is to use od -c, type the key sequence, then Enter, then Ctrl+D. Doing this for Home looks like this for me:

$ od -c

0000000 033   [   7   ~  \n
0000005
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top