Open Stebalien opened 7 years ago
The command didn't create a new terminal/frame so it had to use an existing one. Perhaps you should use emacsclient -t -e '(read-string "prompt: ")'
instead.
Ah, sorry, I meant: After running..., and then hitting enter to close the prompt, EXWM redirects the next keypress to Emacs instead of to the focused X window.
Basically, I'm using emacs as an askpass, dmenu, and zenity replacement so I want to use the existing frame.
@Stebalien How do you send the string to X window, can you share your settings? You may be interested with https://github.com/carnager/rofi-pass.
@QiangF I'm not; I'm just trying to prompt the user for input using emacs. For example, here's my dmenu replacement:
Usually pre-command-hook
/ post-command-hook
is run before/after a command is invoked. But in this case post-command-hook
is not after exit-minibuffer
is invoked which causes the problem. This is quite strange.
It also looks like the command loop never resets this-command
to nil (it stays as exit-minibuffer
). For now, I've just removed all exwm-input--during-command
logic because it seems to work for me (but that's obviously not a real solution. Hopefully I'll get around to reporting this upstream sometime soon.
Ok, that breaks y-or-n-p
. A better work around is to replace the exwm-input--during-command
check with (and exwm-input--during-command (null (eq real-this-command 'exit-minibuffer)))
.
It might have something to do with recursive editing. Actually it's not mandatory or recommended to use pre-command-hook
/post-command-hook
to detect whether Emacs is executing a command. If someone comes up with a better solution, we'll surely adopt that.
Unless I'm mistaken, you should be able to check this-real-command
but that doesn't work fix this because it never gets set back to nil
after executing exit-minibuffer
(hence my workaround). Am I misusing that variable?
I think I tried real-this-command
before but I can't recall why I didn't use that. real-this-command
not get reset seems to be a bug.
After running the following from a normal terminal emulator:
exwm-input--during-command
will remain true causing EXWM to redirect the next keypress to emacs (instead of sending it to the terminal emulator).