diff options
-rw-r--r-- | ranger/api/commands.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/console.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 7f5fcf36..e00fe385 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -92,6 +92,7 @@ class Command(FileManagerAware): self.line = line self.args = line.split() self.quantifier = quantifier + self.quickly_executed = False try: self.firstpart = line[:line.rindex(' ') + 1] except ValueError: @@ -407,6 +408,7 @@ class AliasCommand(Command): def _make_cmd(self): cmd_class = self.fm.commands.get_command(self._line.split()[0]) cmd = cmd_class(self._line + ' ' + self.rest(1)) + cmd.quickly_executed = self.quickly_executed cmd.quantifier = self.quantifier cmd.escape_macros_for_shell = self.escape_macros_for_shell cmd.resolve_macros = self.resolve_macros diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 8dd201e5..b2079d8d 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -359,7 +359,11 @@ class Console(Widget): return self.allow_close = True - self.fm.execute_console(self.line) + if cmd: + cmd.execute() + else: + self.fm.execute_console(self.line) + if self.allow_close: self._close_command_prompt(trigger_cancel_function=False) @@ -419,6 +423,7 @@ class Console(Widget): else: cmd = cls(self.line) if cmd and cmd.quick(): + cmd.quickly_executed = True self.execute(cmd) def ask(self, text, callback, choices=['y', 'n']): |