mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Move bell handling into python
This commit is contained in:
parent
7d2332da21
commit
8b8186660b
2 changed files with 7 additions and 6 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue