Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-g doesn't work in EXWM buffers #118

Open
walseb opened this issue Jan 27, 2025 · 1 comment
Open

C-g doesn't work in EXWM buffers #118

walseb opened this issue Jan 27, 2025 · 1 comment

Comments

@walseb
Copy link
Contributor

walseb commented Jan 27, 2025

Hello!

The C-g key is useful for when you something causes Emacs to hang.

It seems, currently in EXWM, the C-g key isn't forwarded to Emacs while it's busy, even when it's in the prefix keys.

Here's how to reproduce it.

Put this in your config to ensure EXWM allows C-g through:

(setopt exwm-input-prefix-keys
        '(
          ;; C-g
          7
          ))
  1. Open any EXWM buffer
  2. Type M-x eval-expression RET
  3. Type (sleep-for 10)
  4. Type C-g

You should now have to wait for the entire 10 seconds for Emacs to unblock.

quit should be shown in the minibuffer, which is the C-g you ran in step 4 being executed late.

Try it in a normal buffer, and pressing C-g should cancel the sleep right away.

Thoughts?

@Stebalien
Copy link
Contributor

This should be fixable. Currently, when you "pass through" C-g, it gets pushed onto Emacs's internal event queue and won't be processed till sleep-for exits.

I can't find a way to eagerly process commands but we can modify the input handler to:

  1. Detect C-g. Or whatever the quit key happens to be: (nth 3 (current-input-mode)).
  2. Set quit-flag to t.

We'll need to make this behavior customizable.

We'll also likely want to wrap the entire input handling loop in an inhibit-quit block to ensure that this flag doesn't take effect till we're all done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants