mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
@@ -397,7 +397,7 @@ class Boss(Thread):
|
|||||||
self.tab_manager.render(self.cell_program, self.sprites)
|
self.tab_manager.render(self.cell_program, self.sprites)
|
||||||
for window, rd in render_data.items():
|
for window, rd in render_data.items():
|
||||||
if rd is not None:
|
if rd is not None:
|
||||||
window.char_grid.render_cells(rd, self.cell_program, self.sprites)
|
window.render_cells(rd, self.cell_program, self.sprites)
|
||||||
active = self.active_window
|
active = self.active_window
|
||||||
rd = render_data.get(active)
|
rd = render_data.get(active)
|
||||||
if rd is not None:
|
if rd is not None:
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ type_map = {
|
|||||||
'repaint_delay': int,
|
'repaint_delay': int,
|
||||||
'window_border_width': float,
|
'window_border_width': float,
|
||||||
'wheel_scroll_multiplier': float,
|
'wheel_scroll_multiplier': float,
|
||||||
|
'visual_bell_duration': float,
|
||||||
'click_interval': float,
|
'click_interval': float,
|
||||||
'mouse_hide_wait': float,
|
'mouse_hide_wait': float,
|
||||||
'cursor_blink_interval': float,
|
'cursor_blink_interval': float,
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ initial_window_height 400
|
|||||||
# that sufficient for most uses.
|
# that sufficient for most uses.
|
||||||
repaint_delay 10
|
repaint_delay 10
|
||||||
|
|
||||||
|
# Visual bell duration. Flash the screen when a bell occurs for the specified number of
|
||||||
|
# seconds. Set to zero to disable.
|
||||||
|
visual_bell_duration 0.0
|
||||||
|
|
||||||
# The modifier keys to press when clicking with the mouse on URLs to open the URL
|
# The modifier keys to press when clicking with the mouse on URLs to open the URL
|
||||||
open_url_modifiers ctrl+shift
|
open_url_modifiers ctrl+shift
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class Window:
|
|||||||
self._is_visible_in_layout = True
|
self._is_visible_in_layout = True
|
||||||
self.child, self.opts = child, opts
|
self.child, self.opts = child, opts
|
||||||
self.child_fd = child.child_fd
|
self.child_fd = child.child_fd
|
||||||
|
self.start_visual_bell_at = None
|
||||||
self.screen = Screen(self, 24, 80, opts.scrollback_lines)
|
self.screen = Screen(self, 24, 80, opts.scrollback_lines)
|
||||||
self.read_bytes = partial(read_bytes_dump, self.dump_commands) if args.dump_commands else read_bytes
|
self.read_bytes = partial(read_bytes_dump, self.dump_commands) if args.dump_commands else read_bytes
|
||||||
self.draw_dump_buf = []
|
self.draw_dump_buf = []
|
||||||
@@ -109,6 +110,9 @@ class Window:
|
|||||||
def bell(self):
|
def bell(self):
|
||||||
with open('/dev/tty', 'wb') as f:
|
with open('/dev/tty', 'wb') as f:
|
||||||
f.write(b'\007')
|
f.write(b'\007')
|
||||||
|
if self.opts.visual_bell_duration > 0:
|
||||||
|
self.start_visual_bell_at = monotonic()
|
||||||
|
glfw_post_empty_event()
|
||||||
|
|
||||||
def update_screen(self):
|
def update_screen(self):
|
||||||
self.char_grid.update_cell_data()
|
self.char_grid.update_cell_data()
|
||||||
@@ -264,6 +268,14 @@ class Window:
|
|||||||
def buf_toggled(self, is_main_linebuf):
|
def buf_toggled(self, is_main_linebuf):
|
||||||
self.char_grid.scroll('full', False)
|
self.char_grid.scroll('full', False)
|
||||||
|
|
||||||
|
def render_cells(self, render_data, program, sprites):
|
||||||
|
invert_colors = False
|
||||||
|
if self.start_visual_bell_at is not None:
|
||||||
|
invert_colors = monotonic() - self.start_visual_bell_at <= self.opts.visual_bell_duration
|
||||||
|
if not invert_colors:
|
||||||
|
self.start_visual_bell_at = None
|
||||||
|
self.char_grid.render_cells(render_data, program, sprites, invert_colors)
|
||||||
|
|
||||||
# actions {{{
|
# actions {{{
|
||||||
|
|
||||||
def show_scrollback(self):
|
def show_scrollback(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user