flash: convert our own 'flash' from a CSI to an OSC

This commit is contained in:
Daniel Eklöf 2019-07-22 19:10:15 +02:00
parent aa4cf1873b
commit 61409d40e2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 25 additions and 17 deletions

16
csi.c
View file

@ -5,8 +5,6 @@
#include <unistd.h>
#include <assert.h>
#include <sys/timerfd.h>
#if defined(_DEBUG)
#include <stdio.h>
#endif
@ -598,20 +596,6 @@ csi_dispatch(struct terminal *term, uint8_t final)
}
case 1001: {
/* Our own private - flash */
unsigned duration_ms = vt_param_get(term, 1, 100);
LOG_DBG("FLASH for %ums", duration_ms);
struct itimerspec alarm = {
.it_value = {.tv_sec = 0, .tv_nsec = duration_ms * 1000000},
};
if (timerfd_settime(term->flash_timer_fd, 0, &alarm, NULL) < 0)
LOG_ERRNO("failed to arm flash timer");
else {
term->flash_active = true;
}
break;
}
default: