8

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.

Dan
  • 9,492

1 Answers1

20

Use the status command:

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

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

glenn jackman
  • 85,964