summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-05-07 01:15:29 +0200
committerhut <hut@lavabit.com>2011-05-07 01:15:29 +0200
commit06108111403b40196cbb40e7ad3b2480e6dc48de (patch)
treedbd132488e2ed66f69ca41cb061606d3dce5d626
parent288290fcbca607c2c8d11b550ea4029ebff91acf (diff)
downloadranger-06108111403b40196cbb40e7ad3b2480e6dc48de.tar.gz
core.main: Forbid piping things into ranger
-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: