From 4f685934617236b3da6c7c254fa230a4f6c5826f Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 10 Dec 2020 12:11:49 +0300 Subject: .bashrc: prevent nested ranger instances --- %HOME%/.bashrc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '%HOME%') diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index e410cd7..164d7b1 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -105,3 +105,12 @@ os_is_cygwin \ if [ "$TILIX_ID" ] || [ "$VTE_VERSION" ]; then [ -r /etc/profile.d/vte.sh ] && source /etc/profile.d/vte.sh fi + +# Prevent nested ranger instances. +ranger() { + if [ -z "$RANGER_LEVEL" ]; then + /usr/bin/ranger "$@" + else + exit + fi +} -- cgit v1.2.3