aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--csi.c6
-rw-r--r--input.c7
-rw-r--r--selection.c13
-rw-r--r--terminal.c3
4 files changed, 16 insertions, 13 deletions
diff --git a/csi.c b/csi.c
index c22cf2c5..f31fe68a 100644
--- a/csi.c
+++ b/csi.c
@@ -335,7 +335,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 0: {
switch (final) {
case 'c':
- write(term->ptmx, "\033[?6c", 5);
+ vt_to_slave(term, "\033[?6c", 5);
break;
case 'd': {
@@ -598,7 +598,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
snprintf(reply, sizeof(reply), "\x1b[%d;%dR",
term->cursor.row + 1,
term->cursor.col + 1);
- write(term->ptmx, reply, strlen(reply));
+ vt_to_slave(term, reply, strlen(reply));
break;
}
@@ -833,7 +833,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
break;
}
- write(term->ptmx, "\033[?6c", 5);
+ vt_to_slave(term, "\033[?6c", 5);
break;
}
diff --git a/input.c b/input.c
index df7b8a8c..5bb93132 100644
--- a/input.c
+++ b/input.c
@@ -21,6 +21,7 @@
#include "keymap.h"
#include "commands.h"
#include "selection.h"
+#include "vt.h"
static void
keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
@@ -186,7 +187,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
info->keypad_keys_mode != term->keypad_keys_mode)
continue;
- write(term->ptmx, info->seq, strlen(info->seq));
+ vt_to_slave(term, info->seq, strlen(info->seq));
found_map = true;
if (term->grid->view != term->grid->offset) {
@@ -214,9 +215,9 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial,
if (count > 0) {
if (effective_mods & alt)
- write(term->ptmx, "\x1b", 1);
+ vt_to_slave(term, "\x1b", 1);
- write(term->ptmx, buf, count);
+ vt_to_slave(term, buf, count);
if (term->grid->view != term->grid->offset) {
term->grid->view = term->grid->offset;
diff --git a/selection.c b/selection.c
index 241285f3..9fc304c5 100644
--- a/selection.c
+++ b/selection.c
@@ -10,6 +10,7 @@
#include "log.h"
#include "render.h"
#include "grid.h"
+#include "vt.h"
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
@@ -400,7 +401,7 @@ selection_from_clipboard(struct terminal *term, uint32_t serial)
close(write_fd);
if (term->bracketed_paste)
- write(term->ptmx, "\033[200~", 6);
+ vt_to_slave(term, "\033[200~", 6);
/* Read until EOF */
while (true) {
@@ -413,11 +414,11 @@ selection_from_clipboard(struct terminal *term, uint32_t serial)
} else if (amount == 0)
break;
- write(term->ptmx, text, amount);
+ vt_to_slave(term, text, amount);
}
if (term->bracketed_paste)
- write(term->ptmx, "\033[201~", 6);
+ vt_to_slave(term, "\033[201~", 6);
close(read_fd);
}
@@ -448,7 +449,7 @@ selection_from_primary(struct terminal *term)
close(write_fd);
if (term->bracketed_paste)
- write(term->ptmx, "\033[200~", 6);
+ vt_to_slave(term, "\033[200~", 6);
/* Read until EOF */
while (true) {
@@ -461,11 +462,11 @@ selection_from_primary(struct terminal *term)
} else if (amount == 0)
break;
- write(term->ptmx, text, amount);
+ vt_to_slave(term, text, amount);
}
if (term->bracketed_paste)
- write(term->ptmx, "\033[201~", 6);
+ vt_to_slave(term, "\033[201~", 6);
close(read_fd);
}
diff --git a/terminal.c b/terminal.c
index d6d75641..b7c7cf69 100644
--- a/terminal.c
+++ b/terminal.c
@@ -10,6 +10,7 @@
#define LOG_ENABLE_DBG 0
#include "log.h"
#include "grid.h"
+#include "vt.h"
#define min(x, y) ((x) < (y) ? (x) : (y))
#define max(x, y) ((x) > (y) ? (x) : (y))
@@ -337,7 +338,7 @@ report_mouse_click(struct terminal *term, int encoded_button, int row, int col,
return;
}
- write(term->ptmx, response, strlen(response));
+ vt_to_slave(term, response, strlen(response));
}
static void