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