How can I tell whether or not I'm in a guix shell when fish is my default shell?

Simple question. And I ask this because I often leave multiple terminal tabs open with some of them inside guix shell and others not and then decide to go to sleep, wake up the next day and finding myself wondering which tabs did I invoke guix shell and which are still in normal fish mode?

Should I go back to bash?

I think guix should still set the GUIX_ENVIRONMENT environment variable to the path of the profile you have activated (at least it did when I loaded a profile with fish installed and tested guix shell). The expected behavior is that the variable should be present when you’ve loaded an environment with guix shell and not otherwise

Ah, that works!

echo $GUIX_ENVIRONMENT

But I found an even better solution. I determined that since guix shell is likely an extended fish shell, I should look up shells in general and this is what I found:

echo $SHLVL

This one tells me how many shells deep I am, which is even better in my opinion. You never know whether you accidentally double upped your guix shell or other types of shells.

That’s pretty handy. I didn’t know about that