Module: terminal.shortcuts.filters

Filters restricting scope of IPython Terminal shortcuts.

1 Class

class IPython.terminal.shortcuts.filters.PassThrough

Bases: Filter

A filter allowing to implement pass-through behaviour of keybindings.

Prompt toolkit key processor dispatches only one event per binding match, which means that adding a new shortcut will suppress the old shortcut if the keybindings are the same (unless one is filtered out).

To stop a shortcut binding from suppressing other shortcuts: - add the pass_through filter to list of filter, and - call pass_through.reply(event) in the shortcut handler.

__init__()

13 Functions

IPython.terminal.shortcuts.filters.has_focus(value: str | Buffer | UIControl | Container | MagicContainer) Condition

Wrapper around has_focus adding a nice __name__ to tester function

IPython.terminal.shortcuts.filters.ebivim() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.supports_suspend() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.auto_match() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.all_quotes_paired(quote, buf)
IPython.terminal.shortcuts.filters.preceding_text(pattern: str | Callable) Condition
IPython.terminal.shortcuts.filters.following_text(pattern: str) Condition
IPython.terminal.shortcuts.filters.not_inside_unclosed_string() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.navigable_suggestions() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.readline_like_completions() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.is_windows_os() bool

Turn any callable into a Filter. The callable is supposed to not take any arguments.

This can be used as a decorator:

@Condition
def feature_is_active():  # `feature_is_active` becomes a Filter.
    return True
Parameters:

func – Callable which takes no inputs and returns a boolean.

IPython.terminal.shortcuts.filters.eval_node(node: AST | None) Filter | None
IPython.terminal.shortcuts.filters.filter_from_string(code: str) Condition | Filter