zyedidia / micro

A modern and intuitive terminal-based text editor

Home Page:https://micro-editor.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble setting up shift + arrow key support in native terminal

Sataniel98 opened this issue · comments

Description of the problem or steps to reproduce

  • Add script from #802 to "/etc/console-setup/remap.inc" and a new file "supplemental.kmap" with the same contents
  • Run "sudo loadkeys supplemental.kmap"
  • Run "sudo dpkg-reconfigure -u keyboard-configuration"
  • Edit any file with micro
  • Shift + arrow keys pastes escape codes into the file

The problem was mentioned in the old issue, but seems to have been resolved back then. I must be missing something because I'm stuck at that point.

Thank you for your work BTW, Micro has been wonderfully intuitive to get into.

Specifications

Commit hash: 2.0.11-2+b1 (micro -version doesn't output anything else)
OS: Debian 12.8 (headless)
Terminal: Standard

xterm option has to be also enabled when using supplemental.kmap. The option can also be temporarily enabled when running micro -xterm on. However, other keys may not work when xterm is enabled.

A fork of Tcell is used in Micro, but I think enabling xterm or setting TERM to xterm did not have to be done in older versions because the string sequences in supplemental.kmap were added to the entry of linux in zyedidia/tcell@37b7845. The string sequences were somehow removed in updates with upstream code.

The string sequences can be readded but the suggestion mentioned in #1396 (comment) can easily be done in Go using KG_* bit field position macros in linux/keyboard.h. I think it is better if the suggestion mentioned is done but no one has tried implementing it.

Thank you! Resolved it.