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)
href='#n245'>245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378