mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 02:02:14 +02:00
Use a pending update when drawing the screen
This commit is contained in:
@@ -40,6 +40,7 @@ MODES = dict(
|
||||
MOUSE_URXVT_MODE=(1015, '?'),
|
||||
ALTERNATE_SCREEN=(1049, '?'),
|
||||
BRACKETED_PASTE=(2004, '?'),
|
||||
PENDING_UPDATE=(2026, '?'),
|
||||
)
|
||||
|
||||
F = TypeVar('F')
|
||||
@@ -290,6 +291,13 @@ def reset_state(normal_screen: bool = True) -> str:
|
||||
return ans
|
||||
|
||||
|
||||
@contextmanager
|
||||
def pending_update(write: Callable[[str], None]) -> Generator[None, None, None]:
|
||||
write(set_mode('PENDING_UPDATE'))
|
||||
yield
|
||||
write(reset_mode('PENDING_UPDATE'))
|
||||
|
||||
|
||||
@contextmanager
|
||||
def cursor(write: Callable[[str], None]) -> Generator[None, None, None]:
|
||||
write(SAVE_CURSOR)
|
||||
|
||||
Reference in New Issue
Block a user