in nubia/internal/interactive.py [0:0]
def _build_cli(self):
if self._options.persistent_history:
history = FileHistory(
os.path.join(
os.path.expanduser("~"), ".{}_history".format(self._ctx.binary_name)
)
)
else:
history = InMemoryHistory()
# If EDITOR does not exist, take EMACS
# if it does, try fit the EMACS/VI pattern using upper
editor = getattr(
EditingMode, os.environ.get("EDITOR", "EMACS").upper(), EditingMode.EMACS
)
return PromptSession(
history=history,
auto_suggest=AutoSuggestFromHistory(),
lexer=PygmentsLexer(NubiaLexer),
completer=self._completer,
input_processors=[HighlightMatchingBracketProcessor(chars="[](){}")],
style=shell_style,
bottom_toolbar=self._get_bottom_toolbar,
editing_mode=editor,
complete_in_thread=True,
refresh_interval=1,
include_default_pygments_style=False,
)