@@ -234,9 +234,9 @@ def __init__(self, completer, model_completer, docs,
234234 self ._dot_cmd = DotCommandHandler ()
235235 self ._env = os .environ .copy ()
236236 self ._profile = None
237- self .prompt_tokens = u'aws> '
238237 self ._input = input
239238 self ._output = output
239+ self .prompt_tokens = u'aws > '
240240
241241 # These attrs come from the config file.
242242 self .config_obj = None
@@ -285,34 +285,36 @@ def run(self):
285285 document = self .cli .run (reset_current_buffer = True )
286286 if self .model_completer .context and isinstance (self .model_completer .context , list ):
287287 text = " " .join (self .model_completer .context ) + " " + document .text
288+ original_text = document .text
288289 else :
289290 text = document .text
291+ original_text = text
290292 except InputInterrupt :
291293 pass
292294 except (KeyboardInterrupt , EOFError ):
293295 self .save_config ()
294296 break
295297 else :
296- if text .startswith ('.' ):
298+ if original_text .startswith ('.' ):
297299 # These are special commands (dot commands) that are
298300 # interpreted by the aws-shell directly and typically used
299301 # to modify some type of behavior in the aws-shell.
300302 result = self ._dot_cmd .handle_cmd (text , application = self )
301303 if result is EXIT_REQUESTED :
302304 break
303305 else :
304- if text .startswith ('!' ):
306+ if original_text .startswith ('!' ):
305307 # Then run the rest as a normally shell command.
306308 full_cmd = text [1 :]
307- elif text .startswith ('@' ) and len ( text . split ()) == 1 :
309+ elif original_text .startswith ('@' ):
308310 # Add word as context to completions
309311 self .model_completer .context .append (text .split ()[0 ].strip ('@' ))
310312 self .model_completer .reset ()
311313 self .prompt_tokens = u'aws ' + ' ' .join (self .model_completer .context ) + u' > '
312314 self .refresh_cli = True
313315 self .cli .request_redraw ()
314316 continue
315- elif 'exit' in text . split () :
317+ elif original_text == 'exit' :
316318 # Remove most recently added context
317319 if self .model_completer .context :
318320 self .model_completer .context .pop ()
0 commit comments