summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO1
-rw-r--r--ranger/gui/widgets/console.py17
2 files changed, 14 insertions, 4 deletions
diff --git a/TODO b/TODO
index 466ab8f4..d475f099 100644
--- a/TODO
+++ b/TODO
@@ -57,6 +57,7 @@ Bugs
    (X) #26  10/01/06  :delete on symlinks of directories fails
    (X) #31  10/01/06  ^C breaks cd-after-exit by stopping sourced shell script
    ( ) #40  10/01/17  freeze with unavailable sshfs
+          Looks like I need threads for that...
    (X) #41  10/01/17  capital file extensions are not recognized
    (X) #46  10/01/19  old username displayed after using su
    (X) #49  10/01/19  fix unit tests :'(
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index a496f6a9..5439b2a8 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -396,11 +396,20 @@ class OpenConsole(ConsoleWithTab):
 
 	def _get_tab(self):
 		try:
-			position_of_last_space = self.line.rindex(" ")
+			i = self.line.index('!')+1
 		except ValueError:
-			return (program + ' ' for program in self.fm.executables \
-					if program.startswith(self.line))
-		if position_of_last_space == len(self.line) - 1:
+			line = self.line
+			start = ''
+		else:
+			line = self.line[i:]
+			start = self.line[:i]
+
+		try:
+			position_of_last_space = line.rindex(" ")
+		except ValueError:
+			return (start + program + ' ' for program in self.fm.executables \
+					if program.startswith(line))
+		if position_of_last_space == len(line) - 1:
 			return self.line + '%s '
 		else:
 			before_word, start_of_word = self.line.rsplit(' ', 1)