mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Make the screen update delay configurable
Add some comments to the default config
This commit is contained in:
@@ -40,10 +40,10 @@ class Boss(Thread):
|
|||||||
shutting_down = False
|
shutting_down = False
|
||||||
pending_title_change = pending_icon_change = None
|
pending_title_change = pending_icon_change = None
|
||||||
pending_color_changes = {}
|
pending_color_changes = {}
|
||||||
SCREEN_UPDATE_DELAY = 2 / 100 # seconds
|
|
||||||
|
|
||||||
def __init__(self, window, window_width, window_height, opts, args):
|
def __init__(self, window, window_width, window_height, opts, args):
|
||||||
Thread.__init__(self, name='ChildMonitor')
|
Thread.__init__(self, name='ChildMonitor')
|
||||||
|
self.screen_update_delay = opts.repaint_delay / 1000.0
|
||||||
self.pending_update_screen = None
|
self.pending_update_screen = None
|
||||||
self.action_queue = Queue()
|
self.action_queue = Queue()
|
||||||
self.child_fd = create_pty()[0]
|
self.child_fd = create_pty()[0]
|
||||||
@@ -137,6 +137,7 @@ class Boss(Thread):
|
|||||||
|
|
||||||
def apply_opts(self, opts):
|
def apply_opts(self, opts):
|
||||||
self.opts = opts
|
self.opts = opts
|
||||||
|
self.screen_update_delay = opts.repaint_delay / 1000.0
|
||||||
self.queue_action(self.apply_opts_to_screen)
|
self.queue_action(self.apply_opts_to_screen)
|
||||||
|
|
||||||
def apply_opts_to_screen(self):
|
def apply_opts_to_screen(self):
|
||||||
@@ -181,7 +182,7 @@ class Boss(Thread):
|
|||||||
if monotonic() > self.pending_update_screen:
|
if monotonic() > self.pending_update_screen:
|
||||||
self.apply_update_screen()
|
self.apply_update_screen()
|
||||||
elif self.screen.is_dirty():
|
elif self.screen.is_dirty():
|
||||||
self.pending_update_screen = monotonic() + self.SCREEN_UPDATE_DELAY
|
self.pending_update_screen = monotonic() + self.screen_update_delay
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if not self.shutting_down:
|
if not self.shutting_down:
|
||||||
|
|||||||
@@ -204,12 +204,14 @@ def to_bool(x):
|
|||||||
def to_opacity(x):
|
def to_opacity(x):
|
||||||
return max(0.3, min(float(x), 1))
|
return max(0.3, min(float(x), 1))
|
||||||
|
|
||||||
|
|
||||||
type_map = {
|
type_map = {
|
||||||
'scrollback_lines': int,
|
'scrollback_lines': int,
|
||||||
'font_size': to_font_size,
|
'font_size': to_font_size,
|
||||||
'cursor_shape': to_cursor_shape,
|
'cursor_shape': to_cursor_shape,
|
||||||
'cursor_blink': to_bool,
|
'cursor_blink': to_bool,
|
||||||
'cursor_opacity': to_opacity,
|
'cursor_opacity': to_opacity,
|
||||||
|
'repaint_delay': int,
|
||||||
}
|
}
|
||||||
|
|
||||||
for name in 'foreground foreground_bold background cursor'.split():
|
for name in 'foreground foreground_bold background cursor'.split():
|
||||||
@@ -220,17 +222,40 @@ for i in range(16):
|
|||||||
|
|
||||||
for line in '''
|
for line in '''
|
||||||
term xterm-kitty
|
term xterm-kitty
|
||||||
|
# The foreground color
|
||||||
foreground #dddddd
|
foreground #dddddd
|
||||||
foreground_bold #ffffff
|
# The background color
|
||||||
cursor #ffffff
|
|
||||||
cursor_opacity 0.7
|
|
||||||
cursor_shape block
|
|
||||||
cursor_blink no
|
|
||||||
background #000000
|
background #000000
|
||||||
|
|
||||||
|
# The high intensity foreground color
|
||||||
|
foreground_bold #ffffff
|
||||||
|
|
||||||
|
# The cursor color
|
||||||
|
cursor #ffffff
|
||||||
|
|
||||||
|
# The cursor opacity
|
||||||
|
cursor_opacity 0.7
|
||||||
|
|
||||||
|
# The cursor shape can be one of (block, beam, underline)
|
||||||
|
cursor_shape block
|
||||||
|
|
||||||
|
# Whether to blink the cursor or not
|
||||||
|
cursor_blink no
|
||||||
|
|
||||||
|
# Font family
|
||||||
font_family monospace
|
font_family monospace
|
||||||
|
|
||||||
|
# Font size (in pts)
|
||||||
font_size 11.0
|
font_size 11.0
|
||||||
|
|
||||||
|
# Number of lines of history to keep in memory for scrolling back
|
||||||
scrollback_lines 2000
|
scrollback_lines 2000
|
||||||
|
|
||||||
|
# Delay (in milliseconds) between screen updates. Decreasing it, increases fps
|
||||||
|
# at the cost of more CPU usage. The default value yields ~50fps which is more
|
||||||
|
# that sufficient for most uses.
|
||||||
|
repaint_delay 20
|
||||||
|
|
||||||
# black
|
# black
|
||||||
color0 #000000
|
color0 #000000
|
||||||
color8 #4d4d4d
|
color8 #4d4d4d
|
||||||
|
|||||||
Reference in New Issue
Block a user