Short description
- Same
.zshrc
file in both Operating Systems - Most things work fine in Arch, only some don't
- Command:
echo $?
Output:0
PS1="%(?.▶.✘)"
shows the✘
while starting new pts- With
source ~/.zshrc
everything works suddenly
Long description
Okay I am not sure if anyone can help me with this, because I can't even identify the problem exactly. I am just gonna describe what is going on:
So I have the absolutely identical .zshrc
on both my ubuntu
-computer and on my arch
-computer. When I start a terminal-emulator
, zsh
gets loaded and everything goes fine.
When I do it on my arch
-computer tho, it fails. But here comes the thing, it doesn't fail completely. Let me explain:
Most of the aliases, functions and options work perfectly fine. But some don't. Even weirder is, that after I type in
source ~/.zshrc
everything works perfectly fine. It is just at the start.
And the weirdness just continues: I use something like this in my prompt:
PS1="%(?.%(!.%{$fg[yellow]%}▶.%{$fg[cyan]%}▶).%{$fg[red]%}✘)"
In short explained: If the last command failed, it shows the cross
, and if everything went fine, it shows the right arrow
.
As soon as I start the terminal it shows the cross
, so something went wrong. But no error messages are shown...
And last, if I use this command:
echo $?
In short, this shows the exit status code
of the last command.
It shows the Error-Code
of 0
. So it should be all fine right? But no. How can the Prompt see that something went wrong but not $?
or anything else?
I am just so confused and I have no Idea how to debug something like this. If you have any Ideas, please please please let me know.
It isn't the worst thing on earth, it is just annoying. And for the sake of learning it would be interesting, to find out where the problem lies, because this seems rather unusual to me.
(My .zshrc
is over 400 lines of code, I think there is no point in showing it here since it has no errors in itself. If you think otherwise, let me know and I am gonna edit the question)
Thanks for your help :)