status item not reporting $status properly with `not`
PatrickF1 opened this issue · 1 comments
PatrickF1 commented
Describe the bug
The prompt item status
does not properly represent the $status of the previous command executed.
Steps to reproduce
- execute
not false
- observe status comes
✘ 1
- echo
$status
- observe it was 0
It seems that it's not taking account the not
because if you just type in false
or true
normally, it works as expected.
Thank you for maintaining Tide and reading my bug report!
IlanCosman commented
This is actually quite complex unfortunately. I'll have to do some digging and thinking about how to best deal with this.
Here's a sneak peek of the complexity which arises due to piping, and how $pipestatus
and $status
interact with it:
ilan@arch ~> not true | true
ilan@arch ~ [0|0] 1> printf %s\n "status: $status" "pipestatus: $pipestatus"
status: 1
pipestatus: 0 0
ilan@arch ~> true | not false
ilan@arch ~> printf %s\n "status: $status" "pipestatus: $pipestatus"
status: 0
pipestatus: 0 1
ilan@arch ~> false | not true
ilan@arch ~ [1|0] 1> printf %s\n "status: $status" "pipestatus: $pipestatus"
status: 1
pipestatus: 1 0