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
emacs suppended when input(change) too quick in counsel-rg #2517
Comments
This is the gif screenshot. When I press backspace quickly to delete "helpful" (query condition), it cause emacs suppended. |
I got the answer from other website! |
NO, that way does not always WORK. Sometime, it's still suppended. I think it need a useful way to cooperate the sender and the receiver in windows. |
I test this function in the following mininal configuration(put into .emacs file). The emacs is still blocked. (toggle-debug-on-error)
(setq package-user-dir (format "%s/elpa--test-smartparens/%s" user-emacs-directory emacs-version))
(setq package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(defun require-packages (&rest packages)
(dolist (pkg packages)
(unless (package-installed-p pkg)
(package-refresh-contents)
(package-install pkg))
(require pkg)))
(require-packages
'counsel
)
(require 'package)
(defun list-installed-package ()
(mapcar
#'car
(mapcar
(lambda (p) (cons (package-desc-full-name p) p))
(delq nil
(mapcar (lambda (p) (unless (package-built-in-p p) p))
(apply #'append (mapcar #'cdr package-alist)))))))
;; ------------------------------------------------------------------
(add-hook 'after-init-hook
'(lambda ()
(switch-to-buffer "*.c")
(insert "// -*- mode: c -*-\n")
(insert (format "// Installed packages: %s\n" (list-installed-package)))
(insert "// Press ' below:\n")
(c-mode)
))
(run-hooks 'after-init-hook) |
|
another minimal configuration also cause emacs dead: (add-to-list 'load-path "F:/emacs/.emacs.d/elpa--test-smartparens/27.0.60/ivy-20200424.1054/")
(add-to-list 'load-path "F:/emacs/.emacs.d/elpa--test-smartparens/27.0.60/swiper-20200319.1334/")
(add-to-list 'load-path "F:/emacs/.emacs.d/elpa--test-smartparens/27.0.60/counsel-20200422.1208/")
(require 'ivy)
(require 'swiper)
(require 'counsel) |
When I set the delay to this: (setq ivy-dynamic-exhibit-delay-ms 250) all command (especially including C-n and C-p) in ivy are also affected. |
Sorry that it's not working. I use Linux and never had this problem. That's why the default setting for If you or anyone else can manage to fix the problem on Windows, patches are welcome. |
I'd like to try to solve this problem. Could you please give me some suggestion? This is the profile report after reproduced the problem:
|
I suggest examining your Try executing in a different environment, e.g. Cygwin. |
I tested with the latest rg.exe, both under windows native(ripgrep-12.0.1-x86_64-pc-windows-msvc) and gnu(ripgrep-12.0.1-x86_64-pc-windows-gnu). Emacs is still hung. |
In |
But that will ask you confirm: |
The above seems happen sometimes. |
Plus the =kill-process= can also hang emacs. |
I've set (setq ivy-dynamic-exhibit-delay-ms 20)
(setq counsel-async-filter-update-time 1000000) what's your value? |
It's 20 ,500000 |
What's your hacks when using kill-process. (kill-buffer-query-functions
(delq 'process-kill-buffer-query-function kill-buffer-query-functions)) hack from google. |
It sometimes still hang after I set the kill-buffer-query-functions to nil and set the above two as yours. So strange. |
It can lead to hang , sometimes when I delete previous character, sometimes when I input. Maybe it make new process too often. |
@kiennq Some options:
|
Thanks for your options.
|
Sounds like either shell commands on Windows, the way Counsel uses shell commands on Windows, or Bash on Windows specifically is misbehaving. I don't know whether the fault lies with Windows, Bash, Emacs, or Counsel, but perhaps the issue would be resolved by invoking As an aside: I don't know what other Unix-like shells are available on Windows, but perhaps it would be worth testing whether the issue happens with shells other than Bash. |
This is sad. Windows doesn't have a good command shell AFAIK, so using |
I found an old thread that mention using |
With not always spawning new sub process every key strokes, it seems that I can completely eliminate hanging when using @lld2001 You can try with this https://github.com/kiennq/swiper, which are including creating sub process directly without shell and reducing number of new process creations. |
@kiennq Thank you. It works for me by setting |
It does not have the side effect of |
OMG, it accidentally hang. That's very confusing. |
Will increasing |
@lld2001 You can also turn on using subprocess instead of shell command by setting (setq counsel-rg-base-command `("rg" "-M" "1024" "-H" "-n" "--color" "never" "--no-heading"
"-S" "--hidden" "-L" "-P" "%s" ".")) |
@kiennq By increasing |
Can this be close? |
I guess so, at least until further notice. Thanks. |
os:win7(64),
emacs:27.0.60
when I use counsel-rg and input or change the searching condition too quickly, it can cause the emacs suppended. It even cannot be resumed by CTRL+G. There is a "rg.exe" process in windows TASK MANAGER lists. If I kill that process by hand. Then emacs is resumed. I dont konw if there is way I can set the searching delay. Or how cope with this issue.
Sorry, English is not my native language.
The text was updated successfully, but these errors were encountered: