euporie.core.terminal.run_in_terminal

euporie.core.terminal.run_in_terminal(func: Callable[[], prompt_toolkit.application.run_in_terminal._T], render_cli_done: bool = False, in_executor: bool = False) Awaitable[prompt_toolkit.application.run_in_terminal._T]

Run function on the terminal above the current application or prompt.

What this does is first hiding the prompt, then running this callable (which can safely output to the terminal), and then again rendering the prompt which causes the output of this function to scroll above the prompt.

func is supposed to be a synchronous function. If you need an asynchronous version of this function, use the in_terminal context manager directly.

Parameters
  • func – The callable to execute.

  • render_cli_done – When True, render the interface in the ‘Done’ state first, then execute the function. If False, erase the interface first.

  • in_executor – When True, run in executor. (Use this for long blocking functions, when you don’t want to block the event loop.)

Returns

A Future.