How can I check if the current shell is being used from vim?

I am running OS X. On vim, if you do the :sh command, you can drop to a shell to execute commands. I constantly forget whether I am in this shell or not.

Is there any way to check if I am in the shell coming from vim?


env | grep vim lists environment variables that vim passes to your shell. I doubt VIMRUNTIME is defined if you haven't started your shell from vim.


I type ps (without any options) and see if vim is listed.