@@ -233,7 +233,7 @@ def __init__(self, completer, model_completer, docs):
233233 self ._dot_cmd = DotCommandHandler ()
234234 self ._env = os .environ .copy ()
235235 self ._profile = None
236- self .prompt_tokens = u'aws> '
236+ self .prompt_tokens = u'aws > '
237237
238238 # These attrs come from the config file.
239239 self .config_obj = None
@@ -282,34 +282,36 @@ def run(self):
282282 document = self .cli .run (reset_current_buffer = True )
283283 if self .model_completer .context and isinstance (self .model_completer .context , list ):
284284 text = " " .join (self .model_completer .context ) + " " + document .text
285+ original_text = document .text
285286 else :
286287 text = document .text
288+ original_text = text
287289 except InputInterrupt :
288290 pass
289291 except (KeyboardInterrupt , EOFError ):
290292 self .save_config ()
291293 break
292294 else :
293- if text .startswith ('.' ):
295+ if original_text .startswith ('.' ):
294296 # These are special commands (dot commands) that are
295297 # interpreted by the aws-shell directly and typically used
296298 # to modify some type of behavior in the aws-shell.
297299 result = self ._dot_cmd .handle_cmd (text , application = self )
298300 if result is EXIT_REQUESTED :
299301 break
300302 else :
301- if text .startswith ('!' ):
303+ if original_text .startswith ('!' ):
302304 # Then run the rest as a normally shell command.
303305 full_cmd = text [1 :]
304- elif text .startswith ('@' ) and len ( text . split ()) == 1 :
306+ elif original_text .startswith ('@' ):
305307 # Add word as context to completions
306308 self .model_completer .context .append (text .split ()[0 ].strip ('@' ))
307309 self .model_completer .reset ()
308310 self .prompt_tokens = u'aws ' + ' ' .join (self .model_completer .context ) + u' > '
309311 self .refresh_cli = True
310312 self .cli .request_redraw ()
311313 continue
312- elif 'exit' in text . split () :
314+ elif original_text == 'exit' :
313315 # Remove most recently added context
314316 if self .model_completer .context :
315317 self .model_completer .context .pop ()
0 commit comments