summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/main.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index ade3bab5..e6392387 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -24,10 +24,15 @@ def main():
 	import locale
 	import os.path
 	import ranger
+	import sys
 	from ranger.core.shared import (EnvironmentAware, 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: