Some keys not working in console - but why?

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
I'm using a standard extewnded UK keyboard with home/end/pgup/pgdn type keys. In console, the page up/down keys work correctly (eg in scrollback mode). But the home/end keys don't (when typing commands).

I could fix them using key binding in .zshrc, but I'd have thought they are part of a standard keymap. So how can I tell what's going wrong, and fix it?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
There's nothing wrong. You've found a historical artifact: the default key bindings for terminals, both consoles and VT sessions, date to before the IBM Model M keyboard (circa 1984), which introduced the Home/End/PgUp/PgDn keys. The key bindings, in fact, emulate a DEC VT100, circa 1978.

If you do want to muck around with the system keymaps, they're at /usr/share/vt/keymaps. It's probably safer to just fix them locally in .zshrc.
 

Stilez

Guru
Joined
Apr 8, 2016
Messages
529
That fixed it!

But I'm puzzled.

They do recognise PgUp/PgDn, in scrollback and console editors (ee, vi). So if PgUp/Dn are known, why aren't Home/End recognised, as you said, they were introduced same time?
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
This is because the VT100 had scroll control sequences that were easily mapped. Home/End functionality used different key sequences in the different editors (e.g., vi vs emacs), and wasn't native to the VT100.
 
Top