@@ -233,7 +233,7 @@ def __init__(self, completer, model_completer, docs):
233
233
self ._dot_cmd = DotCommandHandler ()
234
234
self ._env = os .environ .copy ()
235
235
self ._profile = None
236
- self .prompt_tokens = u'aws> '
236
+ self .prompt_tokens = u'aws > '
237
237
238
238
# These attrs come from the config file.
239
239
self .config_obj = None
@@ -282,34 +282,36 @@ def run(self):
282
282
document = self .cli .run (reset_current_buffer = True )
283
283
if self .model_completer .context and isinstance (self .model_completer .context , list ):
284
284
text = " " .join (self .model_completer .context ) + " " + document .text
285
+ original_text = document .text
285
286
else :
286
287
text = document .text
288
+ original_text = text
287
289
except InputInterrupt :
288
290
pass
289
291
except (KeyboardInterrupt , EOFError ):
290
292
self .save_config ()
291
293
break
292
294
else :
293
- if text .startswith ('.' ):
295
+ if original_text .startswith ('.' ):
294
296
# These are special commands (dot commands) that are
295
297
# interpreted by the aws-shell directly and typically used
296
298
# to modify some type of behavior in the aws-shell.
297
299
result = self ._dot_cmd .handle_cmd (text , application = self )
298
300
if result is EXIT_REQUESTED :
299
301
break
300
302
else :
301
- if text .startswith ('!' ):
303
+ if original_text .startswith ('!' ):
302
304
# Then run the rest as a normally shell command.
303
305
full_cmd = text [1 :]
304
- elif text .startswith ('@' ) and len ( text . split ()) == 1 :
306
+ elif original_text .startswith ('@' ):
305
307
# Add word as context to completions
306
308
self .model_completer .context .append (text .split ()[0 ].strip ('@' ))
307
309
self .model_completer .reset ()
308
310
self .prompt_tokens = u'aws ' + ' ' .join (self .model_completer .context ) + u' > '
309
311
self .refresh_cli = True
310
312
self .cli .request_redraw ()
311
313
continue
312
- elif 'exit' in text . split () :
314
+ elif original_text == 'exit' :
313
315
# Remove most recently added context
314
316
if self .model_completer .context :
315
317
self .model_completer .context .pop ()
0 commit comments