Prompt Toolkit Key Bindings (xonsh.ptk.key_bindings)

Key bindings for prompt_toolkit xonsh shell.

xonsh.ptk.key_bindings.can_compile(src)[source]

Returns whether the code can be compiled, i.e. it is valid xonsh.

xonsh.ptk.key_bindings.carriage_return(b, cli, *, autoindent=True)[source]

Preliminary parser to determine if ‘Enter’ key should send command to the xonsh parser for execution or should insert a newline for continued input.

Current ‘triggers’ for inserting a newline are: - Not on first line of buffer and line is non-empty - Previous character is a colon (covers if, for, etc...) - User is in an open paren-block - Line ends with backslash - Any text exists below cursor position (relevant when editing previous multiline blocks)

xonsh.ptk.key_bindings.load_xonsh_bindings(key_bindings_manager)[source]

Load custom key bindings.