diff --git a/awsshell/app.py b/awsshell/app.py index 1ec1fd6..7085bf7 100644 --- a/awsshell/app.py +++ b/awsshell/app.py @@ -233,7 +233,7 @@ def __init__(self, completer, model_completer, docs): self._dot_cmd = DotCommandHandler() self._env = os.environ.copy() self._profile = None - self.prompt_tokens = u'aws> ' + self.prompt_tokens = u'aws > ' # These attrs come from the config file. self.config_obj = None @@ -282,15 +282,17 @@ def run(self): document = self.cli.run(reset_current_buffer=True) if self.model_completer.context and isinstance(self.model_completer.context, list): text = " ".join(self.model_completer.context) + " " + document.text + original_text = document.text else: text = document.text + original_text = text except InputInterrupt: pass except (KeyboardInterrupt, EOFError): self.save_config() break else: - if text.startswith('.'): + if original_text.startswith('.'): # These are special commands (dot commands) that are # interpreted by the aws-shell directly and typically used # to modify some type of behavior in the aws-shell. @@ -298,10 +300,10 @@ def run(self): if result is EXIT_REQUESTED: break else: - if text.startswith('!'): + if original_text.startswith('!'): # Then run the rest as a normally shell command. full_cmd = text[1:] - elif text.startswith('@') and len(text.split()) == 1: + elif original_text.startswith('@'): # Add word as context to completions self.model_completer.context.append(text.split()[0].strip('@')) self.model_completer.reset() @@ -309,7 +311,7 @@ def run(self): self.refresh_cli = True self.cli.request_redraw() continue - elif 'exit' in text.split(): + elif original_text == 'exit': # Remove most recently added context if self.model_completer.context: self.model_completer.context.pop()