mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-10 22:24:24 +02:00
Move bell handling into python
This commit is contained in:
@@ -857,12 +857,9 @@ void screen_erase_characters(Screen *self, unsigned int count) {
|
||||
|
||||
void
|
||||
screen_bell(Screen UNUSED *self) {
|
||||
FILE *f = fopen("/dev/tty", "w");
|
||||
static const char *bell = "\007";
|
||||
if (f != NULL) {
|
||||
fwrite(bell, 1, 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
PyObject_CallMethod(self->callbacks, "bell", NULL);
|
||||
if (PyErr_Occurred()) PyErr_Print();
|
||||
PyErr_Clear();
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
||||
@@ -106,6 +106,10 @@ class Window:
|
||||
self.write_buf = memoryview(self.write_buf.tobytes() + data)
|
||||
wakeup()
|
||||
|
||||
def bell(self):
|
||||
with open('/dev/tty', 'wb') as f:
|
||||
f.write(b'\007')
|
||||
|
||||
def update_screen(self):
|
||||
self.char_grid.update_cell_data()
|
||||
glfw_post_empty_event()
|
||||
|
||||
Reference in New Issue
Block a user