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

Last command exit status #9

Open
duncanbeevers opened this issue Aug 12, 2013 · 3 comments
Open

Last command exit status #9

duncanbeevers opened this issue Aug 12, 2013 · 3 comments

Comments

@duncanbeevers
Copy link

In my PS1, I find it useful to see the exit status of the last entered command. In order to do this, I need to define a function that dynamically changes PS1 using PROMPT_COMMAND

function exitstatus {
  if [ $? -eq 0 ]
  then
    export PS1="$PROMPT"
  else
    export PS1="× $PROMPT"
  fi
}

PROMPT_COMMAND='exitstatus'

Does this seem like something worth adding to Halloween, or is the ceremony involved too much?

@xta
Copy link
Owner

xta commented Aug 13, 2013

Hi @duncanbeevers

I'm on the fence, but I understand that it can be easier to read.

What would you name the label? Right now, there is a label for 'exit status', so I'd like to name your Checkmark & X something distinct.

Thanks,
-Rex

@duncanbeevers
Copy link
Author

Well, I'm pretty terrible at naming things. How do these sound?

  • success indicator
  • things ok?
  • good new/bad news
  • checkex
  • happiness

@xta
Copy link
Owner

xta commented Aug 14, 2013

Those are on the right track, but how about something closer to 'exit status with icon'?

Feel free to submit a pull request that I'll review. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants