many times i've been wondering myself if my session (i use plenty of tabs) is "vanilla" or run inside vifm. i've come with this (put into `
.zshrc`
):
if [ $(ps -ocommand= $(ps -oppid= -p $$)) = "vifm" ]
then
printf "\e[48;5;21m"
echo "-- VIFM SHELL SESSION --"
export PROMPT="-- VIFM_SESSION --"$'\n'"${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)"
fi
so it then looks as follows:
-- VIFM SHELL SESSION --
-- VIFM_SESSION --
➜ ~ uname
Linux
-- VIFM_SESSION --
slightly different background would probably be better but i am not sure if it could survive commands like `
reset`
for instance. do you have anything else in mind? maybe this could also go to tips section?