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:
+0200 added examples/plugin_ipc.py' href='/akspecs/ranger/commit/examples/plugin_ipc.py?id=eed176768789208537b6bb8e97f08ef3d4b148fe'>eed17676 ^
dded3cb8 ^
eed17676 ^




b3d031a9 ^
eed17676 ^







b3d031a9 ^
eed17676 ^



b3d031a9 ^


eed17676 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53