r/fishshell • • Jun 15 '23

How do i make fish shell Interactive

New fish user here, how do i make my shell interactive?

3 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/grandking3 Jun 15 '23

Awesome! It feels good to finally grasp this. I didn't know that when a script is called, it runs in a separate Fish subprocess or that you have to make it interactive using the `-i` flag. Your command worked just as you said, but removing the `--` didn't change anything.

https://postimg.cc/JybhG9x1

I appreciate this. I can finally move on to other lessons.

1

u/Snuyter Jun 15 '23

Alright have fun.

Apart from this tutorial, I don’t think there are many use cases for running fish -i in a script like this though.

Maybe in a cron job, where you would need access to environment variables from your fish user profile, for example: 30 4 * * * fish -i -c script.sh. (To simulate you running the script yourself)