geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
920 stars 94 forks source link

Shell startup prompt symbol #204

Closed frm closed 6 years ago

frm commented 6 years ago

I just need to double check if this happens with anyone else or if it is a faulty configuration of mine. Using the current master version of geometry, when starting up the prompt symbol uses the error exit prompt. Example:

screen shot 2018-02-28 at 10 09 56

However, when I echo the contents of the $? variable, before the prompt is rendered, it is still 0. Since I'm running a customized geometry, is any of you able to reproduce this? @desyncr @jedahan

jedahan commented 6 years ago

I'm not able to reproduce, but I have a pretty custom .zshrc so i'm gonna try a minimal one

jedahan commented 6 years ago

I tried with a .zshrc of just source ~/.zr/plugins/geometry-zsh/geometry/geometry.zsh and things looked fine to me

lyneca commented 6 years ago

Same issue. $? was 0 because of previous calls to echo overwriting $? with their return values. I fixed the issue by setting a variable EXIT_VALUE=$? at the start of geometry_plugin_render(), and using this variable throughout the rest of the path plugin.

jedahan commented 6 years ago

I wonder if this behaviour is documented by zsh And we definitely don't want to mangle $? So maybe we restore af the end?

frm commented 6 years ago

$? and $EXIT_VALUE have the same value for me regardless. I don't think we are mangling it.

jedahan commented 6 years ago

So you are still seeing this @fribmendes ?

frm commented 6 years ago

Yes, but I haven't checked with default configs yet. I'm sourcing other things before geometry so maybe one of those is failing and changing the exit value.

jedahan commented 6 years ago

Yeah I got this behaviour when i forgot to install lolcat and had a todo function that failed

frm commented 6 years ago

I finally got around to investigating it.

It wasn't an issue with my zsh configs. rvm added a .zlogin file which attempted to source it. I don't have rvm for quite some time and I don't usually make use of .zlogin, so it took me a while to realize what was happening.

I feel kinda dumb now. Closing this.