Skip to content
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

status item not reporting $status properly with not #451

Open
PatrickF1 opened this issue Oct 6, 2023 · 1 comment
Open

status item not reporting $status properly with not #451

PatrickF1 opened this issue Oct 6, 2023 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@PatrickF1
Copy link
Contributor

Describe the bug

The prompt item status does not properly represent the $status of the previous command executed.

Steps to reproduce

  1. execute not false
  2. observe status comes ✘ 1
  3. echo $status
  4. 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!

@PatrickF1 PatrickF1 added the 🐛 bug Something isn't working label Oct 6, 2023
@IlanCosman
Copy link
Owner

IlanCosman commented Oct 7, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
2 participants