Index: uspace/app/terminal/terminal.c
===================================================================
--- uspace/app/terminal/terminal.c	(revision 09f41d3d60ae4abb40aff09edace1ef60c15b484)
+++ uspace/app/terminal/terminal.c	(revision 47d060dc4e7035ebfea2fa54953c74fd8e0f402a)
@@ -403,5 +403,7 @@
 		if (pos < size) {
 			link_t *link = prodcons_consume(&term->input_pc);
-			cons_event_t *event = list_get_instance(link, cons_event_t, link);
+			terminal_event_t *qevent = list_get_instance(link,
+			    terminal_event_t, link);
+			cons_event_t *event = &qevent->ev;
 
 			/* Accept key presses of printable chars only. */
@@ -417,5 +419,5 @@
 			}
 
-			free(event);
+			free(qevent);
 		}
 	}
@@ -635,7 +637,7 @@
 	terminal_t *term = srv_to_terminal(srv);
 	link_t *link = prodcons_consume(&term->input_pc);
-	cons_event_t *ev = list_get_instance(link, cons_event_t, link);
-
-	*event = *ev;
+	terminal_event_t *ev = list_get_instance(link, terminal_event_t, link);
+
+	*event = ev->ev;
 	free(ev);
 	return EOK;
@@ -823,10 +825,10 @@
 {
 	/* Got key press/release event */
-	cons_event_t *event =
-	    (cons_event_t *) malloc(sizeof(cons_event_t));
+	terminal_event_t *event =
+	    (terminal_event_t *) malloc(sizeof(terminal_event_t));
 	if (event == NULL)
 		return;
 
-	*event = *ev;
+	event->ev = *ev;
 	link_initialize(&event->link);
 
Index: uspace/app/terminal/terminal.h
===================================================================
--- uspace/app/terminal/terminal.h	(revision 09f41d3d60ae4abb40aff09edace1ef60c15b484)
+++ uspace/app/terminal/terminal.h	(revision 47d060dc4e7035ebfea2fa54953c74fd8e0f402a)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2023 Jiri Svoboda
+ * Copyright (c) 2024 Jiri Svoboda
  * Copyright (c) 2012 Petr Koupy
  * All rights reserved.
@@ -46,4 +46,5 @@
 #include <gfx/coord.h>
 #include <io/con_srv.h>
+#include <io/cons_event.h>
 #include <loc.h>
 #include <stdatomic.h>
@@ -102,4 +103,12 @@
 } terminal_t;
 
+/** Terminal event */
+typedef struct {
+	/** Link to list of events */
+	link_t link;
+	/** Console event */
+	cons_event_t ev;
+} terminal_event_t;
+
 extern errno_t terminal_create(const char *, sysarg_t, sysarg_t,
     terminal_flags_t, const char *, terminal_t **);
