about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/main.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 319b248f..5aa08a93 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -15,10 +15,6 @@ def main():
     from ranger.core.shared import FileManagerAware, SettingsAware
     from ranger.core.fm import FM
 
-    if not sys.stdin.isatty():
-        sys.stderr.write("Error: Must run ranger from terminal\n")
-        raise SystemExit(1)
-
     try:
         locale.setlocale(locale.LC_ALL, '')
     except:
@@ -107,6 +103,10 @@ def main():
                     print(chr(key))
             return 1 if arg.fail_unless_cd else 0 # COMPAT
 
+        if not sys.stdin.isatty():
+            sys.stderr.write("Error: Must run ranger from terminal\n")
+            raise SystemExit(1)
+
         if fm.username == 'root':
             fm.settings.preview_files = False
             fm.settings.use_preview_script = False