View Issue Details

IDProjectCategoryView StatusLast Update
0006676Kali LinuxKali Package Improvementpublic2020-09-30 11:28
Reporterwordeater Assigned Todaniruiz  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Product Version2020.3 
Summary0006676: /etc/skel/.zshrc missing bindkeys for numpad
Description

The /etc/skel/.zshrc file is missing some bindings that would allow the numpad and the home and end keys to work properly.
The button to turn numlock on or off also fails.
I added these lines to my ~/.zshrc file to get the keys working on my system based on information from these two URLs.
https://superuser.com/questions/742171/zsh-z-shell-numpad-numlock-doesnt-work
https://stackoverflow.com/questions/8638012/fix-key-settings-home-end-insert-delete-in-zshrc-when-running-zsh-in-terminat

bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line

Keypad

0 . Enter

bindkey -s "^[Op" "0"
bindkey -s "^[On" "."
bindkey -s "^[OM" "^M"

1 2 3

bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"

4 5 6

bindkey -s "^[Ot" "4"
bindkey -s "^[Ou" "5"
bindkey -s "^[Ov" "6"

7 8 9

bindkey -s "^[Ow" "7"
bindkey -s "^[Ox" "8"
bindkey -s "^[Oy" "9"

+ - * /

bindkey -s "^[Ol" "+"
bindkey -s "^[OS" "-"
bindkey -s "^[OR" "*"
bindkey -s "^[OQ" "/"

Steps To Reproduce

Have an older version of Kali Linux such as 2020.2.

Follow the quick upgrade instructions.
kali@kali:~$ echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
kali@kali:~$
kali@kali:~$ sudo apt update && sudo apt -y full-upgrade
kali@kali:~$
kali@kali:~$ [ -f /var/run/reboot-required ] && sudo reboot -f

Follow the instructions to copy the /etc/skel/.zshrc file to your home directory
kali@kali:~$ cp /etc/skel/.zshrc ~/
kali@kali:~$

Run zsh and try to use the numpad. It will fail.

Additional Information

I am SSHing into my Kali VM using SecureCRT. This particular VM has been running the 'rolling' distribution for about a year and has nightly updates run with 'cron-apt'.

I also have Kali on WSL2 on my personal laptop which I will try when I am off work later today.

Attached Files

Activities

wordeater

wordeater

2020-08-24 15:20

reporter   ~0013315

I'm attaching screenshots of the possibly relevant SecureCRT terminal emulation settings.

wordeater

wordeater

2020-08-25 14:46

reporter   ~0013319

I tried to recreate the issue on my WSL2 install of Kali last night and I was not able to.
The numpad worked OOTB for the cmd.exe Kali zsh prompt, the Microsoft Terminal Kali zsh prompt, and the native Terminal on the kex Kali GUI.

I also tested on the first system again using the VMware remote console instead of SecureCRT over SSH. Even without the bindings present in the .zshrc file, the numpad keys work.

The only time I have problems is when I SSH into the VMware Kali linux system. I tried KiTTY and was able to reproduce the problem I had with SecureCRT.

daniruiz

daniruiz

2020-09-02 12:31

manager   ~0013377

I don't know why you're having this issue with the numpad, but it is working perfectly for me.

The keybindings that you are using are actually forcing the keys with the numlock enabled to behave as the numlock is disabled, which isn't correct.

For example, if you have the numlock enabled, if you press the key '7' your terminal receives the code '7', so there's no need for a keybinding for it. If you have the numlock disabled, pressing the key '7' sends the code '^[OH', which is already binded by bindkey -e and properly behaves like the Home key.
What you are actually doing there is forcing zsh to read '^[OH' like '7'

Maybe your issue is caused by the fact that you're SSHing to kali and the terminal you're using is not sending the codes properly

Issue History

Date Modified Username Field Change
2020-08-24 15:15 wordeater New Issue
2020-08-24 15:20 wordeater File Added: SecureCRT-TerminalSettings01.jpg
2020-08-24 15:20 wordeater File Added: secureCRT-TerminalSettings02.jpg
2020-08-24 15:20 wordeater File Added: secureCRT-TerminalSettings03.jpg
2020-08-24 15:20 wordeater Note Added: 0013315
2020-08-25 14:46 wordeater Note Added: 0013319
2020-09-02 12:31 daniruiz Note Added: 0013377
2020-09-02 12:31 daniruiz Assigned To => daniruiz
2020-09-02 12:31 daniruiz Status new => assigned
2020-09-30 11:28 daniruiz Status assigned => closed
2020-09-30 11:28 daniruiz Resolution open => won't fix