summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-01-11 10:31:53 +0100
committerhut <hut@lavabit.com>2012-01-11 16:51:18 +0100
commit8c917a95c27e5293f762b018edc0751e95cf9726 (patch)
tree285df850b69d05e3f8dbb3df671d252c17deb136
parent8d0782c20ce033ae69fa6f134f68af0e9862acdc (diff)
downloadranger-8c917a95c27e5293f762b018edc0751e95cf9726.tar.gz
defaults.commands: on <tab> in !shell put the filename instead of %s
-rw-r--r--ranger/defaults/commands.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py
index 6cfeff17..087d9b14 100644
--- a/ranger/defaults/commands.py
+++ b/ranger/defaults/commands.py
@@ -218,7 +218,11 @@ class shell(Command):
 			return (start + program + ' ' for program \
 					in get_executables() if program.startswith(command))
 		if position_of_last_space == len(command) - 1:
-			return self.line + '%s '
+			selection = self.fm.env.get_selection()
+			if len(selection) == 1:
+				return self.line + selection[0].shell_escaped_basename + ' '
+			else:
+				return self.line + '%s '
 		else:
 			before_word, start_of_word = self.line.rsplit(' ', 1)
 			return (before_word + ' ' + file.shell_escaped_basename \