term-keys - lossless keyboard input for Emacs This package allows configuring Emacs and a supported terminal emulator to handle keyboard input involving any combination of keys and modifiers. Table of Contents Introduction Generally, terminal emulators and applications running in a terminal cannot reliably transmit and receive certain keystrokes (keys in combination with modifiers). For some key combinations, there is no consensus on how these events should be encoded on the wire (F-keys and movement keys plus modifiers); some other key combinations cannot be represented at all (such as Ctrl 1 or Ctrl Shift A ). This can be an impediment for Emacs users, especially when you've already configured your Emacs in an environment unrestricted by these limitations (X11) and now wish to use it in the terminal as well. The term-keys package allows solving this problem by giving these key combinations a custom, unique encoding, overcoming the limitations of the protocol implemented by the terminal emulators. Installation To install term-keys , first add my ELPA package archive. Add this to your init.el and evaluate it: ( require 'package ) ; you may already have this line ( add-to-list 'package-archives '( " cselpa " . " https://elpa.thecybershadow.net/packages/ " )) Then, install it like any ELPA package ( M-x package-install RET term-keys ). Setup Setting up term-keys is a three-part process: Configure Emacs; Configure term-keys (optional); Configure your terminal emulator. See the sections below for more information. Configuring Emacs Setting up term-keys is as easy as: ( require 'term-keys ) (term-keys-mode t ) This will automatically set up current and new TTY frames to decode term-keys key sequences. If you prefer to enable it for each frame manually, you can do so by invoking (term-keys/init) . Configuring term-keys term-keys is very configurable. Most things can be changed via Emacs' customize interface - use M-x customize-group RET term-keys to access it. Some of the...
First seen: 2025-12-06 22:20
Last seen: 2025-12-07 01:21