mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: CSI log messages are now single line
This commit is contained in:
parent
b8017a36de
commit
3bd77bceb1
1 changed files with 24 additions and 5 deletions
29
csi.c
29
csi.c
|
|
@ -5,6 +5,10 @@
|
|||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(_DEBUG)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#define LOG_MODULE "csi"
|
||||
#define LOG_ENABLE_DBG 1
|
||||
#include "log.h"
|
||||
|
|
@ -78,13 +82,28 @@ csi_sgr(struct terminal *term)
|
|||
bool
|
||||
csi_dispatch(struct terminal *term, uint8_t final)
|
||||
{
|
||||
LOG_DBG("CSI: %zu paramaters, final = %c", term->vt.params.idx, final);
|
||||
for (size_t i = 0; i < term->vt.params.idx; i++) {
|
||||
LOG_DBG(" #%zu: %u", i, term->vt.params.v[i].value);
|
||||
for (size_t j = 0; j < term->vt.params.v[i].sub.idx; j++)
|
||||
LOG_DBG(" #%zu: %u", j, term->vt.params.v[i].sub.value[j]);
|
||||
#if defined(_DEBUG)
|
||||
char log[1024];
|
||||
int c = snprintf(log, sizeof(log), "CSI: ");
|
||||
|
||||
for (size_t i = 0; i < term->vt.params.idx; i++){
|
||||
c += snprintf(&log[c], sizeof(log) - c, "%d",
|
||||
term->vt.params.v[i].value);
|
||||
|
||||
for (size_t j = 0; i < term->vt.params.v[i].sub.idx; j++) {
|
||||
c += snprintf(&log[c], sizeof(log) - c, ":%d",
|
||||
term->vt.params.v[i].sub.value[j]);
|
||||
}
|
||||
|
||||
c += snprintf(&log[c], sizeof(log) - c, "%s",
|
||||
i == term->vt.params.idx - 1 ? "" : ";");
|
||||
}
|
||||
|
||||
c += snprintf(&log[c], sizeof(log) - c, "%c (%zu parameters)",
|
||||
final, term->vt.params.idx);
|
||||
LOG_DBG("%s", log);
|
||||
#endif
|
||||
|
||||
if (term->vt.intermediates.idx == 0) {
|
||||
switch (final) {
|
||||
case 'c':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue