Function keys are not supported
Function keys are not yet supported in PTerm. Some applications that use them are GNU Midnight Commander and htop.
While trying to implement support for function keys, I encountered a slight problem: TerminalEmulatorXterm nominally mimics xterm, but TerminalEmulator’s #environ actually sets the ‘TERM’ environment variable to ‘linux’, and these two terminals use different sequences for some of the function keys. The sequences for each can be gotten from ‘tput’ through the following snippet:
#(xterm linux)
collect: [ :type |
type -> ((1 to: 24)
collect: [ :n |
(KeyboardKey named: ('F{1}' format: { n })) ->
(LibC resultOfCommand: ('tput -T {1} kf{2}' format: { type. n })) ]
as: OrderedDictionary) ]
as: OrderedDictionary
Yes i remember settting TERM to linux for some reason (can't recall which one though, probably something related to the themes).
We could change it to xterm or xterm-256color, but need to check for any side effects