ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

ergoemacs in terminal mode breaks keybingings for arrows, functional keys #502

Closed kirill-lapshin closed 1 year ago

kirill-lapshin commented 3 years ago

There are number of old issues on this topic, e.g. #280. I'm accessing Linux machine from windows via Git bash, putty and run emacs in terminal (not X).

  1. If I start emacs without config (emacs -Q) arrows work
  2. After issuing (require 'ergoemacs-mode) in scratch buffer they stop working and instead print out letters, e.g. A for arrow up, B for arrow down Tested in both git bash and putty. Arrow behaviour is the same in both.

For functional keys same experiment produces different results. In git bash functional keys are broken same way as arrows, but they work fine in putty even after loading ergoemacs.

Using emacs 27.1 and recent ergoemacs from github.

mattfidler commented 3 years ago

This should be fixed in the github version.

berkeleynerd commented 2 years ago

Using the github version I am still encountering this issue. I'm using ksh and xterm on OpenBSD 7.0

boykov commented 1 year ago

@mattfidler I think when check is unnecessary here

(defun ergoemacs-fix-arrow-keys (keymap)
  "Fix arrow keys for KEYMAP."
  (let (ergoemacs-M-O-binding)
    (when ergoemacs-M-O-binding
      (setq ergoemacs-M-O-binding (lookup-key keymap (kbd "M-O")))
      (define-key keymap (kbd "M-O") 'ergoemacs-handle-M-O)
      (define-key keymap [ergoemacs-meta-O] ergoemacs-M-O-binding))))

The variable ergoemacs-M-O-binding is always nil due to let statement.

I removed it and the function works now.

mattfidler commented 1 year ago

Thanks @boykov

Removed