##// END OF EJS Templates
Allow autosuggestions to be configurable.
Alexander Steppke -
Show More
@@ -317,6 +317,11 b' class TerminalInteractiveShell(InteractiveShell):'
317 help="Allows to enable/disable the prompt toolkit history search"
317 help="Allows to enable/disable the prompt toolkit history search"
318 ).tag(config=True)
318 ).tag(config=True)
319
319
320 enable_autosuggestions = Bool(True,
321 help="Allows to enable/disable the prompt autosuggestions based on "
322 "the prompt toolkit history.",
323 ).tag(config=True)
324
320 prompt_includes_vi_mode = Bool(True,
325 prompt_includes_vi_mode = Bool(True,
321 help="Display the current vi mode (when using vi editing mode)."
326 help="Display the current vi mode (when using vi editing mode)."
322 ).tag(config=True)
327 ).tag(config=True)
@@ -370,11 +375,16 b' class TerminalInteractiveShell(InteractiveShell):'
370 self._style = self._make_style_from_name_or_cls(self.highlighting_style)
375 self._style = self._make_style_from_name_or_cls(self.highlighting_style)
371 self.style = DynamicStyle(lambda: self._style)
376 self.style = DynamicStyle(lambda: self._style)
372
377
378 if self.enable_autosuggestions:
379 auto_suggest = AutoSuggestFromHistory()
380 else:
381 auto_suggest = None
382
373 editing_mode = getattr(EditingMode, self.editing_mode.upper())
383 editing_mode = getattr(EditingMode, self.editing_mode.upper())
374
384
375 self.pt_loop = asyncio.new_event_loop()
385 self.pt_loop = asyncio.new_event_loop()
376 self.pt_app = PromptSession(
386 self.pt_app = PromptSession(
377 auto_suggest=AutoSuggestFromHistory(),
387 auto_suggest=auto_suggest,
378 editing_mode=editing_mode,
388 editing_mode=editing_mode,
379 key_bindings=key_bindings,
389 key_bindings=key_bindings,
380 history=history,
390 history=history,
General Comments 0
You need to be logged in to leave comments. Login now