Key binding error when using gdb through ssh in SLES 11

I am using gdb in a remote computer to which I am connected through ssh. The problem is that there are some key bindings I usually use that are wrong. Specially, the problem is that the keys “Page-Up” and “Page-Down” are interpreted as the character “~” instead of perform the Page-Up / Page-Down operation. I have been searching in google for days but I have been unabled to find an answer.

I have tested the above connecting from other computers with Windows (MobaxTerm) and SLES 12. In both cases, the Page-Up / Page-Down key works properly. so the problem only appears when I connect to the other computer from SLES 11.

I have tried to use sh, bash and csh, and nothing works.

What is going wrong?

Interesting; out of curiosity (as I am a gdb amateur) what do page-up and
page-down do in gdb?

Anyway, I believe this is something you can fix pretty easily by modifying
your user’s (or the system’s) ~/.inputrc file. I was able to see what you
saw, and then I just appended /etc/inputrc to the end of ~/.inputrc (which
already exists, but only had commented-out and blank lines) using the
following command:

cat /etc/inputrc >> ~/.inputrc

There is a section in there on ‘xterm’ being used as the terminal (true
for me when SSHing from my laptop (OpenSUSE) to my server (SLES 11)) so I
presume one of those lines are specifically helping.

Logged out and back in, and now I do not see tildes; I do not see anything
really, but I suspect that is because I do not know what it should be
doing, or I am not in the right part of gdb; I’ll rely on you to let me
know if that works.

For the record, deleting my user’s ~/.inputrc file also seemed to do the
same thing:

rm ~/.inputrc
#logout/login


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

Thanks for the answer.

Asnwering to your question, if you have enabled the history search with page-up / page-down keys in your terminal (bash, sh, csh …), you can use the same feature in gdb,. That is, imagine you write “break main” in the gdb prompt. Then, type “bre” and press page-up. gdb should complete your sentence until “break main”, like a typical terminal. This is so useful for large gdb commands.

Regards.

Thanks for the explanation.

Did the inputrc stuff work?


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.