mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 07:24:41 +02:00
Avoid flicker when starting kittens such as the hints kitten
Fixes #4674
This commit is contained in:
@@ -206,18 +206,23 @@ class HandleResult:
|
||||
type_of_input: Optional[str] = None
|
||||
no_ui: bool = False
|
||||
|
||||
def __init__(self, impl: Callable[..., Any], type_of_input: Optional[str], no_ui: bool):
|
||||
def __init__(self, impl: Callable[..., Any], type_of_input: Optional[str], no_ui: bool, has_ready_notification: bool):
|
||||
self.impl = impl
|
||||
self.no_ui = no_ui
|
||||
self.type_of_input = type_of_input
|
||||
self.has_ready_notification = has_ready_notification
|
||||
|
||||
def __call__(self, args: Sequence[str], data: Any, target_window_id: int, boss: BossType) -> Any:
|
||||
return self.impl(args, data, target_window_id, boss)
|
||||
|
||||
|
||||
def result_handler(type_of_input: Optional[str] = None, no_ui: bool = False) -> Callable[[Callable[..., Any]], HandleResult]:
|
||||
def result_handler(
|
||||
type_of_input: Optional[str] = None,
|
||||
no_ui: bool = False,
|
||||
has_ready_notification: bool = False
|
||||
) -> Callable[[Callable[..., Any]], HandleResult]:
|
||||
|
||||
def wrapper(impl: Callable[..., Any]) -> HandleResult:
|
||||
return HandleResult(impl, type_of_input, no_ui)
|
||||
return HandleResult(impl, type_of_input, no_ui, has_ready_notification)
|
||||
|
||||
return wrapper
|
||||
|
||||
@@ -413,6 +413,11 @@ def restore_colors() -> str:
|
||||
return '\x1b[#Q'
|
||||
|
||||
|
||||
@cmd
|
||||
def overlay_ready() -> str:
|
||||
return '\x1bP@kitty-overlay-ready|\x1b\\'
|
||||
|
||||
|
||||
@cmd
|
||||
def write_to_clipboard(data: Union[str, bytes], use_primary: bool = False) -> str:
|
||||
from base64 import standard_b64encode
|
||||
|
||||
Reference in New Issue
Block a user