-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
iTerm2 crashes #107
Comments
I'm seeing a similar behavior, except that it's not a crash, and it's when I hit tab, not space. In my case, the iterm2 window closes because the process exited, because zsh segfaulted. Haven't had time to investigate further, my gdb-fu is weak. |
@kergoth Same problem here, I'm using the latest iTerm2 nightly and pressing tab immediately closes the window. |
Can you confirm you still have this problem with a minimal configuration? Try installing with: $ git clone git://github.com/tarruda/zsh-autosuggestions ~/.zsh/zsh-autosuggestions and confirming you have the latest version: $ git -C ~/.zsh/zsh-autosuggestions rev-parse --short HEAD
011f542 and using the following source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh Then start a new terminal session and confirm the problem persists. |
zsh does not crash in that case, here. I'll try to isolate the configuration which crashes. |
Thanks! In my experience this is usually caused by something invoking a |
I've been trying to narrow it down to specific line and so far zsh-syntax-highlighting and zsh-history-substring-search cause the similar coredump. This happens on both zsh v5.0.8 and v5.2. The sourcing order does matter. If I do zsh-syntax-highlighting first and then zsh-autosuggestions.zsh it does not coredump as noted below. set -x has not revealed anything obvious either.
|
@kergoth This is another clue. What is tab bound to? Run |
Thanks @lexinator I'll look into this. |
both zsh-syntax-highlighting and zsh-history-substring-search define zle, and the coredump is 500ish level stacktrace, so I suspect your theory on recursive zle is correct. thanks. |
Indeed, thanks for the guidance, you're absolutely correct. Is the correct fix to add the zle widgets in question that call the originals to ZSH_AUTOSUGGEST_MODIFY_WIDGETS? |
@lexinator I believe the segfault you produced above is created by loading zsh-syntax-highlighting after Sourcing both plugins at the same prompt (simulating the behavior of loading % /bin/zsh -f
% . ~/src/zsh-autosuggestions/zsh-autosuggestions.zsh; . ~/src/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh |
My personal belief (though I have yet to confirm it) is that the correct fix is for any plugin invoking a widget that it does not have control over to do one of two things:
Though it seems there's a lot of code out there that does neither of these things and just calls possibly user-defined widgets without the So for now, yeah, you can sometimes break the infinite recursion by removing the widget in question from one of the config lists (this is what the fix in the readme for |
sorry to have joined this issue since mine now seems unrelated. @ericfreese sourcing the scripts in a single run fixed the coredump. The next issue I ran into was https://github.com/solarnz/dotfiles/blob/master/zsh/10-expand-or-complete-with-dots.zsh causing another coredump upon tab. As you said in #107 (comment), the fix is to prefix '.' on the zle functions to avoid recursion. thanks for the quick reply. |
I believe v0.2.6 should fix all of these issues without requiring changes to other plugins. Please give that a shot. Edit: v0.2.6 had a typo. Try v0.2.7 |
just installed the plugin, crashes still happen upon pressing forward char. I installed as oh-my-zsh plugin
edit: maybe because i was in tmux? |
This fix is described in - zsh-users/zsh-autosuggestions#107 (comment) - sorin-ionescu/prezto#1026
I have the same problem. Every time I do source ~/.zshrc, the next key press make iterm crash. If I comment one of the above lines, the problem is gone. |
Same issue with iTerm2. Removing zsh-autosuggestions from plugins resolves issue.
|
@MikeBailleul @kylealwyn Please try the |
Awesome, thanks. |
Recalling precmd_functions is only needed when cwd is changed, which means when `jump` is called. `.reset-prompt`: bypass the zsh-syntax-highlighting wrapper<Paste> - sorin-ionescu/prezto#1026 - zsh-users/zsh-autosuggestions#107 (comment) `-R`: redisplay the prompt to avoid old prompts being eaten up - Powerlevel9k/powerlevel9k#1176 (comment)
(As requested in #103 I created this as a separate topic)
While the initial error is now resolved the plugin now crashes my terminal window as soon as I enter a "space" after any command, i.e. "ping(space)".
I'm using iTerm2 and load all plugins with the zgen framework. Here is my setup:
In a .zgen file
In .zshrc
Your plugin is loaded from the repro and is on the v0.1.0 branch.
The text was updated successfully, but these errors were encountered: