summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-12-05 04:55:23 +0100
committerhut <hut@lepus.uberspace.de>2015-12-05 04:55:23 +0100
commit3b6ecb1501ab41e4df0fe0c0882be83435f21445 (patch)
tree9ea6dabc30af00a0316d1861822e1a15c69e39bc
parenta6831bcfaed029632d34812b7b7bebda01438c5e (diff)
downloadranger-3b6ecb1501ab41e4df0fe0c0882be83435f21445.tar.gz
core.main: moved 'must run ranger in terminal' message
previously this error denied the user from running
'ranger --list-tagged-files=X' outside of a terminal.  Now it only
denies running ranger interactively outside of a terminal.
-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