-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
When using helm from terminal emacs, typing too quickly may result in helm unexpectedly closing #2417
Comments
Shane Mulligan ***@***.***> writes:
Steps to reproduce (recipe)
Install helm-dash.
I don't know what is helm-dash, please report bug to the helm-dash
maintainer.
Thanks.
…--
Thierry
|
Some packages using helm implement a source without specifying that it is a process. So every package that does this is broken. Because most users are using GUI then there are many helm packages broken for terminal emacs. But fixing it here will fix it for all. I will also report to the |
Here is some more information on the issue. I think there are two problems here and the issue should be fixed in both |
Shane Mulligan ***@***.***> writes:
[[PGP Encrypted Part:OK]]
Some packages using helm implement a source without specifying that it is a process. So every package that does this is broken. Because most users are using GUI then there are many helm
packages broken for terminal emacs. But fixing it here will fix it for
all.
Thanks for explanations, however I don't think it is a good idea to set
inhibit-quit for all when running helm in a terminal, I would prefer
people create their sources properly. IOW I don't think it is a good
idea to make a fix in helm for badly written helm sources.
(defun helm-dash--build-source (docset)
"Build a Helm source for DOCSET."
(lexical-let ((docset docset))
(helm-build-sync-source (car docset)
:action-transformer #'helm-dash-actions
:candidates (lambda ()
(cl-loop for row in (helm-dash--run-query docset helm-pattern)
collect (helm-dash--candidate docset row)))
:volatile t
:persistent-help "View doc"
:requires-pattern helm-dash-min-length)))
Clearly this source is badly written, first of all it uses `lexical-let`
please stop using this even if it is unrelated to this bug.
Then indeed a better implementation would use `helm-build-async-source`
instead and use :candidates-process with a function returning a process.
If one really want to make such source sync, probably it is a better
idea to cache the result of the function calling the process (assume it
is a call-process and not start-process) and use the cache in the
:candidates function instead of calling constantly a process each time
input changes, but it seems it is not possible here (don't know exactly
what dash is and do).
Thanks.
…--
Thierry
|
I can easily reproduce this bug with one of our old source |
A workaround is to use a smaller (defun helm-dash (&optional input-pattern)
"Bring up a `helm-dash' search interface.
If INPUT-PATTERN is non-nil, use it as an initial input in helm search."
(interactive)
(helm-dash-initialize-debugging-buffer)
(helm-dash-create-common-connections)
(helm-dash-create-buffer-connections)
(helm :sources (helm-dash--sources-narrowed-docsets)
:buffer "*helm-dash*"
:prompt "Doc for: "
:history 'helm-dash-history-input
:input input-pattern
:candidate-number-limit 1000
:input-idle-delay 0.6)) |
With
That's all I know so far. |
A I'm not sure where the best placement is. That would be up to a
|
So I'd just like to reiterate, this is two separate problems, both related to terminal emacs. 1) Pending keyboard input is interrupting |
Shane Mulligan ***@***.***> writes:
So I'd just like to reiterate, this is two separate problems, both
related to terminal emacs.
Thanks for looking into this and summarize problems, I will look into
this in the next days.
…--
Thierry
|
Hey @thierryvolpiatto . Sadly, I think the |
I have sent a bug report to emacs. |
Shane Mulligan ***@***.***> writes:
I have sent a bug report to emacs.
I think it is now fixed, now pushing to devel branch.
…--
Thierry
|
This fixes the problem for me, too. Thank you. |
If an emacs maintainer sees this as I noted this issue in the bug report. please still consider the fix to
|
Although the |
Hey @thierryvolpiatto , I may have resolved this issue upstream in emacs with the following patch to
https://asciinema.org/a/VAn7LrFeJbVzNTWM2Pkc90BRD I also submitted a PR to https://framagit.org/steckerhalter/helm-google/-/merge_requests/21 |
Shane Mulligan ***@***.***> writes:
I may have resolved this issue upstream in emacs with the following patch to url-retrieve-synchronously.What this achieves is to trigger a quit in a controlled environment rather than
allowing it to occur when accept-process-output is run.
It's not always wanted to trigger a quit when (input-pending-p) is t. But I noticed from placing while-no-input around accept-process-output to avoid the quit that
url-retrieve-synchronously would then hang but with the controlled
quit happening beforehand, accept-process-output no longer needs
while-no-input around it.
while-no-input is itself wrapping body inside a with-local-quit, that is
maybe the reason.
The end result is buttery smooth helm with no accidental quit from
typing too fast.
With last changes I made in helm, I have no unexpected exits even when
using url-retrieve-synchronously, have a try.
Thanks.
…--
Thierry
|
Expected behavior
Helm should not quit when typing too quickly in terminal emacs, when using a package such as helm-dash, which generates candidates using an external process, but who's source does not say that it uses a process.
Actual behavior (from
emacs-helm.sh
if possible, see note above)Helm will unexpectedly quit after a bell is generated from typing too fast. Inhibit-quit is not enabled by
helm-get-candidates
because helm doesn't know the source uses an external process.Steps to reproduce (recipe)
Install
helm-dash
.Run emacs in the terminal like
emacs -nw
.Install a docset using
helm-dash-install-docset
.Run
helm-dash
and typeplaybook
really quickly, or mash keys.At this stage the helm has probably quit unexpectedly with no error message.
in
*messages*
, you may see the following:Describe versions of Helm, Emacs, operating system, etc.
Are you using
emacs-helm.sh
to reproduce this bug? (yes/no):no
Potential fix:
Change inhibit-quit to be permanently t, or do a check for terminal emacs frame.
The text was updated successfully, but these errors were encountered: