문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top