diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index ecc1b836f8b83c1c89f24f5862a9ea27fa448c98..a6ee174259f7ef506665176235a3a72ef8073ddb 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -1913,7 +1913,8 @@ x11_event(XEvent *ev)
 								if (ch) {
 									// Bow to GCC
 									if (ch == 0xe0) // Double-up 0xe0
-										write(key_pipe[1], &ch, 1);
+										if (write(key_pipe[1], &ch, 1) == -1)
+											return;
 									if (write(key_pipe[1], &ch, 1) == EXIT_SUCCESS)
 										return;
 									else