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.
Asked
Active
Viewed 4,263 times
1 Answers
18
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
- 84,176
- 15
- 116
- 168
-
As of fish version 3.3.1, its `status is-login`. – myTerminal Jan 28 '22 at 04:53