From 996d1e51c79e8d112fc5e774192c415ce79e15a9 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 22 Jan 2026 18:39:23 +0100 Subject: [PATCH] fix off by one --- .config/ranger/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/ranger/commands.py b/.config/ranger/commands.py index f803f45..fef260b 100644 --- a/.config/ranger/commands.py +++ b/.config/ranger/commands.py @@ -65,13 +65,13 @@ class my_edit(Command): class smart_shell(Command): """:smart_shell - If SHLVL == 1, spawn a new shell in the current directory. - If SHLVL > 1, quit ranger (same as pressing 'q'). + If SHLVL == 0, spawn a new shell in the current directory. + If SHLVL >= 1, quit ranger (same as pressing 'q'). """ def execute(self): shlvl = int(os.environ.get('SHLVL', 1)) - if shlvl > 1: + if shlvl >= 1: # We're in a nested shell, quit ranger to return to parent shell self.fm.execute_console('quit') else: