Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
complete_while_typing=session.complete_while_typing,
lexer=None,
completer=SmartPathCompleter(),
prompt_key_bindings=create_shell_key_bindings()
)
session.register_mode(
"browse",
native=True,
activator=browse_activator,
insert_new_line=True,
history_share_with="r",
message=lambda: ANSI(session.browse_prompt.format(session.browse_level)),
multiline=session.indent_lines,
complete_while_typing=True,
lexer=PygmentsLexer(SLexer),
completer=RCompleter(timeout=session.completion_timeout),
prompt_key_bindings=create_r_key_bindings(prase_text_complete),
switchable_from=False,
switchable_to=False
)
session.register_mode(
"unknown",
native=True,
insert_new_line=True,
message=lambda: ANSI(session.prompt_text),
complete_while_typing=False,
lexer=None,
completer=None,
prompt_key_bindings=None,
switchable_from=False,
switchable_to=False
)
shell.run_command(text)
input_processors = []
if settings.highlight_matching_bracket:
input_processors.append(HighlightMatchingBracketProcessor())
session.register_mode(
"r",
activator=lambda session: session.prompt_text == settings.prompt,
insert_new_line=True,
history_share_with="browse",
get_message=lambda: settings.prompt,
multiline=settings.indent_lines,
complete_while_typing=settings.complete_while_typing,
lexer=PygmentsLexer(SLexer),
completer=RCompleter(),
key_bindings=create_key_bindings(),
input_processors=input_processors,
prompt_key_bindings=create_r_key_bindings(prase_text_complete)
)
session.register_mode(
"shell",
on_post_accept=shell_process_text,
insert_new_line=True,
get_message=lambda: settings.shell_prompt,
multiline=settings.indent_lines,
complete_while_typing=settings.complete_while_typing,
lexer=None,
completer=SmartPathCompleter(),
prompt_key_bindings=create_shell_key_bindings()
)
session.register_mode(
def __init__(self):
super(RCompleter, self).__init__()
def __init__(self, timeout=0.02):
self.timeout = timeout
super(RCompleter, self).__init__()
complete_while_typing=settings.complete_while_typing,
lexer=None,
completer=SmartPathCompleter(),
prompt_key_bindings=create_shell_key_bindings()
)
session.register_mode(
"browse",
activator=browse_activator,
# on_pre_accept=browse_on_pre_accept, # disable
insert_new_line=True,
history_share_with="r",
get_message=lambda: settings.browse_prompt.format(session.browse_level),
multiline=settings.indent_lines,
complete_while_typing=True,
lexer=PygmentsLexer(SLexer),
completer=RCompleter(timeout=settings.completion_timeout),
input_processors=input_processors,
prompt_key_bindings=create_r_key_bindings(prase_text_complete),
switchable_from=False,
switchable_to=False
)
session.register_mode(
"unknown",
insert_new_line=False,
get_message=lambda: session.prompt_text,
complete_while_typing=False,
lexer=None,
completer=None,
prompt_key_bindings=None,
switchable_from=False,
switchable_to=False,
input_processors=[]