Why does psql insert a tilde when I press any of the keys in the Home key cluster?

I am using psql 8.2.3 on FreeBSD. Each time I click Insert , Home , Delete , End , Page Up or Down Page, a tilde character ( ~) is inserted instead of the symbol of the expected key function . Why is this happening and how can I fix it?

+3
source share
2 answers

As mentioned in the Endlessdeath answer , this turned out to be a key mapping problem with the operating system ( FreeBSD ), not PSQL . You can make these keys work properly by creating or adding a configuration file for inputrc.

You can create a file with a name .inputrcin your home directory with the following:

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word

Alternatively, you can create a global file for all users. A common practice for this is to create or add to the file in /usr/local/etc/inputrcthe same lines as above, and then export the variable to /etc/profile:

export INPUTRC=/usr/local/etc/inputrc

, /etc/profile ( ), . , , .

:

+4

psql - ​​. google .

+1

Source: https://habr.com/ru/post/1703118/