summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO12
-rw-r--r--ranger/actions.py8
-rw-r--r--ranger/applications.py11
-rw-r--r--ranger/defaults/keys.py3
4 files changed, 22 insertions, 12 deletions
diff --git a/TODO b/TODO
index b1bad60a..87da0de8 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,7 @@ Console
 
    (X) #0   09/12/06  console commands
    (X) #1   09/12/06  quick find
-   ( ) #2   09/12/06  open with
+   (X) #2   09/12/06  open with
    ( ) #3   09/12/06  MVC for widgets
    (X) #4   09/12/06  history for console
 
@@ -12,10 +12,8 @@ General
    (X) #5   09/12/06  move code from fm into objects
    (X) #6   09/12/06  move main to __init__
    (X) #7   09/12/06  cooler titlebar
-   ( ) #9   09/12/24  add a widget for managing running operations
-   (X) #10  09/12/24  sorting
-
-
-Filesystem Modification Operations
-
    (X) #8   09/12/17  Add operations to modify files/directories
+   (X) #9   09/12/24  add a widget for managing running operations
+   (X) #10  09/12/24  sorting
+   ( ) #11  09/12/27  filter
+   ( ) #12  09/12/27  jump through the list in a specific order
diff --git a/ranger/actions.py b/ranger/actions.py
index 31f4cb41..aa2cc311 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -192,10 +192,14 @@ class Actions(EnvironmentAware, SettingsAware):
 		if func is not None:
 			self.env.settings['sort'] = str(func)
 	
-	def spawn(self, command):
+	def spawn(self, cmd, suspend=False, wait=False):
 		from ranger.applications import spawn
-		spawn(command, fm=self)
+		spawn(cmd, fm=self, suspend=wait, wait=wait)
 	
+	def runcmd(self, cmd, suspend=True, wait=True):
+		from ranger.applications import spawn
+		spawn(cmd, fm=self, suspend=wait, wait=wait)
+
 	def force_load_preview(self):
 		cf = self.env.cf
 		if cf is not None:
diff --git a/ranger/applications.py b/ranger/applications.py
index ed5f282e..ae1ca2e1 100644
--- a/ranger/applications.py
+++ b/ranger/applications.py
@@ -81,10 +81,15 @@ def spawn(command, fm=None, suspend=True, wait=True):
 		fm.ui.suspend()
 
 	try:
-		if fm and fm.stderr_to_out:
-			process = Popen(command, shell=True, stderr=STDOUT)
+		if wait:
+			kw = {}
 		else:
-			process = Popen(command, shell=True)
+			kw = {'stdout':null, 'stderr':null, 'stdin':null}
+
+		if fm and fm.stderr_to_out:
+			if 'stderr' not in kw:
+				kw['stderr'] = STDOUT
+		process = Popen(command, shell=True, **kw)
 		if wait:
 			waitpid_no_intr(process.pid)
 	finally:
diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py
index 88f570df..fcd6591e 100644
--- a/ranger/defaults/keys.py
+++ b/ranger/defaults/keys.py
@@ -82,6 +82,9 @@ def initialize_commands(command_list):
 	bind('cd', do('open_console', cmode.COMMAND, 'cd '))
 	bind('f', do('open_console', cmode.COMMAND_QUICK, 'find '))
 
+	bind('term', do('spawn', 'x-terminal-emulator'))
+	bind('du', do('runcmd', 'du --max-depth=1 -h | less'))
+
 	# key combinations which change the current directory
 	def cd(path):
 		return lambda fm: fm.enter_dir(path)
ble: improved (but not fixed) test_boundaries' href='/akspecs/ranger/commit/test/tc_displayable.py?h=v1.9.0b1&id=1c72dd08f2f7d551094cea2ccf5d824fe1aef1ca'>1c72dd08 ^
152823d8 ^

1c72dd08 ^

152823d8 ^

1c72dd08 ^


152823d8 ^









1159f9ec ^
1159f9ec ^


dd4a4145 ^
1159f9ec ^
dd4a4145 ^





1159f9ec ^
dd4a4145 ^


1159f9ec ^
dd4a4145 ^


1159f9ec ^
1159f9ec ^


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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162