ergoemacs/ergoemacs-mode

spurious bracket characters due to focus events, failure to handle xterm-paste

pdg137 opened this issue · 3 comments

I'm running Windows Terminal with a msys2 shell, ssh to Ubuntu 22.04 with Emacs 27.1 and ergoemacs-mode-5.16.10.12.

TERM is xterm-256color.

In this configuration emacs -q seems to ignore focus/unfocus events (from e.g. Alt+Tab) and can accept a paste from the Windows OS with Ctrl+V.

However, a minimal ergoemacs configuration breaks on both kinds of events. The focus events move the cursor around and insert [ characters, while Ctrl+V generates a message about xterm-paste being unbound:

image

Some info about terminal focus events is here: https://github.com/veelenga/terminal-focus-reporting.el

I think the desired behavior would be to

  • either disable / ignore terminal focus events or bind them to the appropriate emacs commands
  • accept xterm-paste

In case it helps, you can work around the first problem by calling the function terminal-focus-reporting--deactivate from that package after emacs is loaded. This kind of thing makes it work in init.el:

(use-package terminal-focus-reporting
  :demand t
  :ensure t
  :config
  (unless (display-graphic-p)
    (add-hook 'ergoemacs-mode-startup-hook
              (lambda ()
                (message "Disabling focus reporting...")
                (terminal-focus-reporting--deactivate)
                )
              )))

I just realized I was stuck on an old version.

This stuff works fine on ergoemacs-mode-5.22.2.23.

Awesome! Thanks for figuring it out