Index: uspace/lib/clui/tinput.c
===================================================================
--- uspace/lib/clui/tinput.c	(revision 36a75a2ebea94aea971bd83a0590dd676373a253)
+++ uspace/lib/clui/tinput.c	(revision 3aae4e89c4b282c2c55a468b0ba490d1c1f4cb74)
@@ -513,6 +513,12 @@
 }
 
-/** Read in one line of input. */
-char *tinput_read(tinput_t *ti)
+/** Read in one line of input.
+ *
+ * @param ti	Text input.
+ * @param dstr	Place to save pointer to new string.
+ * @return	EOK on success, ENOENT if user requested abort, EIO
+ *		if communication with console failed.
+ */
+int tinput_read(tinput_t *ti, char **dstr)
 {
 	console_event_t ev;
@@ -522,7 +528,7 @@
 
 	if (console_get_size(fphone(stdin), &ti->con_cols, &ti->con_rows) != EOK)
-		return NULL;
+		return EIO;
 	if (console_get_pos(fphone(stdin), &ti->col0, &ti->row0) != EOK)
-		return NULL;
+		return EIO;
 
 	ti->pos = ti->sel_start = 0;
@@ -530,9 +536,10 @@
 	ti->buffer[0] = '\0';
 	ti->done = false;
+	ti->exit_clui = false;
 
 	while (!ti->done) {
 		fflush(stdout);
 		if (!console_get_event(fphone(stdin), &ev))
-			return NULL;
+			return EIO;
 
 		if (ev.type != KEY_PRESS)
@@ -565,4 +572,7 @@
 	}
 
+	if (ti->exit_clui)
+		return ENOENT;
+
 	ti->pos = ti->nc;
 	tinput_position_caret(ti);
@@ -575,5 +585,6 @@
 	ti->hpos = 0;
 
-	return str;
+	*dstr = str;
+	return EOK;
 }
 
@@ -606,4 +617,9 @@
 	case KC_A:
 		tinput_sel_all(ti);
+		break;
+	case KC_Q:
+		/* Signal libary client to quit interactive loop. */
+		ti->done = true;
+		ti->exit_clui = true;
 		break;
 	default:
Index: uspace/lib/clui/tinput.h
===================================================================
--- uspace/lib/clui/tinput.h	(revision 36a75a2ebea94aea971bd83a0590dd676373a253)
+++ uspace/lib/clui/tinput.h	(revision 3aae4e89c4b282c2c55a468b0ba490d1c1f4cb74)
@@ -64,11 +64,13 @@
 	/** Current position in history */
 	int hpos;
-	/** Exit flag */
+	/** @c true if finished with this line (return to caller) */
 	bool done;
+	/** @c true if user requested to abort interactive loop */
+	bool exit_clui;
 } tinput_t;
 
 extern tinput_t *tinput_new(void);
 extern void tinput_destroy(tinput_t *ti);
-extern char *tinput_read(tinput_t *ti);
+extern int tinput_read(tinput_t *ti, char **str);
 
 #endif
