-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Module syntax-highlighting with prezto causes zsh to exit immediately #1026
Comments
Looks like it's an issue in zsh 5.0.5. Running
However, if I run zsh 5.1 there is not segfault and the syntax-highlighting module works just fine. I don't know if this is something that can be worked around or if it's not worth the energy given v5.1 works. |
Which highlights have you enabled? |
I haven't explicitly enabled any highlights, which I assume means just the main highlight should be loaded by default. This is with a fresh clone of prezto (with the only modification being the |
No script should segfault Zsh. Can you upgrade Zsh? You might want to open an issue on the zsh-syntax-highlighting page. |
I can (and have) upgraded my zsh, but zsh 5.0.5 is what ships on OS X. I'm not sure if this is a prezto issue or not. It doesn't crash if I completely remove prezto (and all of its
(where But as soon as I use prezto (with zsh 5.0.5) with syntax-highlighting, zsh crashes. Additionally, if I change my prezto prompt theme to |
I just did a bit more investigating. Looks like the crash happens if line 93 of I can't tell exactly when the segfault occurs. It's certainly after the |
You might want to try |
It's specifically the call to |
all that does is redraw the prompt. Unless zsh had a bug that caused that to bug out, that isn't the problem. |
Does it help if you change |
using |
From a cursory reading, it seems like this fix: may be why it bugs on earlier versions of zsh and not later versions. I cannot reproduce this, and therefore cannot debug it. The fact that it is segfaulting indicates it is a zsh problem. |
This is crashing on an earlier version than 5.0.8 for both myself and OP (zsh 5.0.5); It's the version both OS X and Ubuntu 14.04 LTS ship with. Agree that it's a zsh problem, but a recent pull of prezto+zsh-syntax-highlighting is triggering it. I'll try to find time to bisect to see if I can find what change on the prezto/syntax-highlighting side is making this happen. |
No, as far as I can tell, this is an async problem. The sorin and pure prompts use async. That is exactly my point; this problem in zsh core was fixed in version 5.1. |
If you switch to a different prompt and the problem continues, then it indicates it is a prezto/syntax-highlighting problem. That said, I find that to be HIGHLY unlikely. This is very likely a memory corruption problem that happens when zsh tries to handle child processes, hence the segfault. |
Then perhaps call them both: |
Another thing: try using |
OK. I'll play with it. This has been working fine for a while before I merged in from prezto's HEAD and updated submodules, though. It was using async before. |
@danielshahaf zle .reset-prompt seems to be working |
Oh, yes, that is understandable @zlegs. It is possible that there was something that changed (within the past 5 months that have passed since @sorin-ionescu updated it) that is now triggering this problem. That I understand. I'm just saying that the problem lies in zsh's process handling code, which was apparently fixed in 5.1. That explains why this was happening. |
In this case, try disabling zsh-syntax-highlighting and adding a dummy wrapper instead: # 1. disable syntax highlighting
# 2. add a dummy wrapper:
f() { zle .$WIDGET "$@" }; zle -N reset-prompt f For future reference, there's an experimental zsh-syntax-highlighting branch that will remove the need for the widget-wrapping dance: https://github.com/danielshahaf/zsh-syntax-highlighting/tree/mikachu-redrawhook/v2; it depends a patch to zsh itself: https://github.com/zsh-users/zsh/tree/mikachu/redrawhook (by @Mikachu) |
@danielshahaf what's the difference between |
@ziegs In theory, when |
This is happening in zsh 5.2 too Any workaround for this? |
Is this a Prezto issue, a conflict with the editor module, or a zsh-syntax-highlighting issue? Prezto does not modify zsh-syntax-highlighting. It's an external module. |
same issue here .. any workaround? |
To expand on @sorin-ionescu's question: Does this happen when starting zsh as |
@danielshahaf, I followed the process that you described and it's working ... |
@yriveiro So that tells us it's not an issue in z-sy-h upstream; it might be an issue in prezto or in the combination of prezto and z-sy-h. I hope Sorin or someone else will be able to debug this further; I'm not a prezto user myself, I just maintain z-sy-h upstream. |
@danielshahaf I have difficulty debugging it since I do not experience it. |
@sorin-ionescu Understood, but since the problem doesn't occur without prezto loaded, neither I nor zsh upstream is likely to be able to help you reproduce or solve the problem... |
I'm having the same problem on Ubuntu 12.04.5 LTS with zsh 4.3.17 whenever I enable 'syntax-highlighting' . zsh exits immediately. This is pretty frustrating and I have no idea how to solve this. I'm using the following modules:
I'm also running it on OSX 10.11.2 with zsh 5.2 where I don't have any problems. |
Hi guys, I was able to debug this issue. The line that causes the issue is here. We are trying to access I get the same issue with just |
It also seems to run fine on OSX with zsh 5.0.8 (homebrew), but I'm definitely seeing the issue on my Ubuntu 14.04 boxes. I'll see if upgrading to zsh 5.2 helps, but it would be nice if @thekondr has found a fixable problem. |
Confirmed that using zsh 5.2 on Ubuntu 14.04 works fine. |
OSX 10.10.2 with zsh 5.2 has same issue. |
OSX 10.10.5 with zsh 5.2 has same issue. |
Same issue on Centos 7, Zsh 5.0.2 |
This fix is described in - zsh-users/zsh-autosuggestions#107 (comment) - sorin-ionescu/prezto#1026
I haven't been able to reproduce this on macOS 10.12.4 with zsh 5.2. If anyone manages to figure out exactly what's causing this issue, I'd be happy to look into it. It's just fairly hard to debug if I can't reproduce it. |
I got the same problem. And setting |
What was TERM set to when it crashed? And what platform was it on? |
|
There have been some changes with how async tasks and zle reset-prompt are used in the sorin prompt. Can anyone here confirm this is still happening since I haven't been able to reproduce it yet? Thanks! |
Still happening with zsh 5.4.1 and prezto-git on Arch |
I don't know if it's related but my gnome-terminal session completely crashes using the sorin theme sporadically on ubuntu 14.04 and zsh 5.0.2 |
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)
I'm on OS X 10.10.5 using zsh 5.0.5 (x86_64-apple-darwin14.0). This happens in both iTerm2 and Apple's Terminal app. If I add the syntax-highlighting module to my
.zpreztorc
, so the module loading looks like this:Here's me logging in with a pristine prezto install (I just cloned and set it up, so it's prezto at revision 165879d):
And here's me logging in after enabling syntax-highlighting (adding
'syntax-highlighting' \
is the only change I've made to my.zpreztorc
):Note that zsh now immediately exits upon login.
The text was updated successfully, but these errors were encountered: