mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +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
|
void
|
||||||
screen_bell(Screen UNUSED *self) {
|
screen_bell(Screen UNUSED *self) {
|
||||||
FILE *f = fopen("/dev/tty", "w");
|
PyObject_CallMethod(self->callbacks, "bell", NULL);
|
||||||
static const char *bell = "\007";
|
if (PyErr_Occurred()) PyErr_Print();
|
||||||
if (f != NULL) {
|
PyErr_Clear();
|
||||||
fwrite(bell, 1, 1, f);
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ class Window:
|
|||||||
self.write_buf = memoryview(self.write_buf.tobytes() + data)
|
self.write_buf = memoryview(self.write_buf.tobytes() + data)
|
||||||
wakeup()
|
wakeup()
|
||||||
|
|
||||||
|
def bell(self):
|
||||||
|
with open('/dev/tty', 'wb') as f:
|
||||||
|
f.write(b'\007')
|
||||||
|
|
||||||
def update_screen(self):
|
def update_screen(self):
|
||||||
self.char_grid.update_cell_data()
|
self.char_grid.update_cell_data()
|
||||||
glfw_post_empty_event()
|
glfw_post_empty_event()
|
||||||
|
|||||||
Reference in New Issue
Block a user