I want to be able to check if a fish shell is being run in login, interactive, or batch mode, and this question only discusses bash.


Use the status command:

$ fish -c 'status --is-interactive; and echo yes; or echo no'
$ status --is-interactive; and echo yes; or echo no

Also, status --is-login. That should cover your bases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.