dylanaraps / fff

📁 A simple file manager written in bash.
MIT License
4.09k stars 173 forks source link

How to know that i'am in a shell opened by fff #169

Closed plavenu closed 3 years ago

plavenu commented 3 years ago

Hello all,

it possible to know that we are in fff after opening shells in it ?

To be more clearful :

open fff then open a shell ! reopen a fff in this shell ! and so on ...

How to know that i'am in a shell opened by fff ?

Thanks for you tool.

dimo414 commented 3 years ago

pstree -sa $$ will show you the parents of the current process; which will include a bash /path/to/fff line if you're within a fff-created shell. There are other similar commands if pstree isn't quite what you want.

fff also exports a FFF_LEVEL variable to the subshell's environment, but unless that's documented to always be set (in future versions of fff, I mean) it may be safer to treat that as an implementation detail and instead inspect the process tree.

plavenu commented 3 years ago

So great @dimo414 this exactly what i want Great thanks.