summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/loader.py4
-rwxr-xr-xranger/data/scope.sh4
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 7fd7dbab..d063148b 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -70,8 +70,9 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware):
 		self.stdout_buffer = ""
 
 	def generate(self):
+		null = open(os.devnull, 'r')
 		self.process = process = Popen(self.args,
-				stdout=PIPE, stderr=PIPE)
+				stdout=PIPE, stderr=PIPE, stdin=null)
 		self.signal_emit('before', process=process, loader=self)
 		if self.silent and not self.read:
 			while process.poll() is None:
@@ -114,6 +115,7 @@ class CommandLoader(Loadable, SignalDispatcher, FileManagerAware):
 				if py3:
 					read = safeDecode(read)
 				self.stdout_buffer += read
+		null.close()
 		self.finished = True
 		self.signal_emit('after', process=process, loader=self)
 
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 6ab9df51..4d778486 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -3,8 +3,8 @@
 # Its output is used as the preview.  ANSI color codes are supported.
 
 # NOTES: This script is considered a configuration file.  If you upgrade
-# ranger, it will be left untouched. (You must update it yourself)
-# NEVER make this script interactive. (by starting mplayer or something)
+# ranger, it will be left untouched. (You must update it yourself.)
+# Also, ranger disables STDIN here, so interactive scripts won't work properly
 
 # Meanings of exit codes:
 # code | meaning    | action of ranger
/a> ^
b96af395 ^
ce87c19e ^
b96af395 ^
b0bf5321 ^
ce87c19e ^
b96af395 ^
f192d655 ^
ee72abae ^
b96af395 ^
f192d655 ^
760f683f ^
b96af395 ^
77d5b5d6 ^
4a48bedc ^
b96af395 ^

9458918f ^
5b22547b ^
b96af395 ^
08f4628e ^
b96af395 ^

f192d655 ^
b96af395 ^
f192d655 ^
1ead3562 ^
77d5b5d6 ^
760f683f ^
b96af395 ^
192d59d3 ^

ce87c19e ^

b96af395 ^
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