I have kali linux on my laptop.I have a problem with my keyboard . Whenever i open a terminal some key is pressed automatically and
^[[5~ this character is shown in terminal. Please tell me which key causes this issue.
Per the ECMA-48 standard,
[ is the 7-bit equivalent to the 8-bit C1 control character
CSI. Your terminal emulator, because of massive historical inertia, is acting as if it is not 8-bit clean.
Any terminal input control sequence of the form
~ is a DECFNK control sequence. (Ps2, and thus the
;, are optional, defaulting in the usual ECMA-48 style to 1 if missing.) This is a de facto standard control sequence originating in DEC terminals and copied by other terminals and terminal emulators over the years.
The VT510 Video Terminal Programmer Information documents the DECFNK control sequence on pages 5—53 to 5—53, albeit not with the IBM PC key names that you are used to. It is the Prev Screen key. It is in the upper group of the editing keypad area of this VT320 keyboard:
You can guess what its IBM PC Model M keyboard equivalent is from that, but when still consulting the doco nonetheless you will also find
~ in table 8—3 on page 8—7 of VT520/VT525 Video Terminal Programmer Information. That table documents that it is engraved Page Up on an IBM PC style keyboard.
Use reference doco like this to look up keyboard control sequences.
Note that this applies to terminals that use the DEC VT protocols. Not all terminals and terminal emulators do. If you encounter an input control sequence beginning with
SS3 that is not in the
~ form, it will usually (unless it is an actual ECMA-48 control sequence) be employing the other widely used protocol, which is the protocol originally adopted for IBM PC keyboard keys on the SCO Xenix console.
The DEC VT doco documents some of these control sequences as its compatibility "SCO Console" mode. These are fully documented in the keyboard(HW) manual page in the SCO Unix System Administrators Reference.
You'll find them used, for example, by the FreeBSD kernel's built-in terminal emulator for function keys F13 and higher. (It uses the DEC VT control sequences for F1 to F12. There are DEC VT control sequences for function keys up to F22. The SCO Xenix console has documented control sequences for function keys F1 to F48, reflecting the common IBM PC convention of using modifier keys to quadruple the number of function keys.)
- VT510 Video Terminal Programmer Information. EK-VT510-RM. November 1993. DEC.
- VT520/VT525 Video Terminal Programmer Information. EK-VT520-RM. July 1994. DEC.
- "Hardware Dependent". SCO Unix System Administrators Reference. 1993-02-01. The Santa Cruz Operation. tenox.net.
- Control Functions for Coded Character Sets. ECMA-48. 5th edition. 1991. ECMA International.