Index: uspace/app/bdsh/input.c
===================================================================
--- uspace/app/bdsh/input.c	(revision 59ecd4a3b0bd29d1e4c177ddfdbd67f9774eb336)
+++ uspace/app/bdsh/input.c	(revision 5db9084cb9b925c6758f4bc0fac5c31d7125ff35)
@@ -50,4 +50,6 @@
 #include "errors.h"
 #include "exec.h"
+
+extern volatile unsigned int cli_quit;
 
 /** Text input field. */
@@ -107,4 +109,5 @@
 {
 	char *str;
+	int rc;
 
 	fflush(stdout);
@@ -114,5 +117,16 @@
 	console_set_style(fphone(stdout), STYLE_NORMAL);
 
-	str = tinput_read(tinput);
+	rc = tinput_read(tinput, &str);
+	if (rc == ENOENT) {
+		/* User requested exit */
+		cli_quit = 1;
+		putchar('\n');
+		return;
+	}
+
+	if (rc != EOK) {
+		/* Error in communication with console */
+		return;
+	}
 
 	/* Check for empty input. */
Index: uspace/app/bdsh/scli.c
===================================================================
--- uspace/app/bdsh/scli.c	(revision 59ecd4a3b0bd29d1e4c177ddfdbd67f9774eb336)
+++ uspace/app/bdsh/scli.c	(revision 5db9084cb9b925c6758f4bc0fac5c31d7125ff35)
@@ -100,7 +100,7 @@
 		}
 	}
-	goto finit;
 
-finit:
+	printf("Leaving %s.\n", progname);
+
 	cli_finit(&usr);
 	return ret;
Index: uspace/app/sbi/src/os/helenos.c
===================================================================
--- uspace/app/sbi/src/os/helenos.c	(revision 59ecd4a3b0bd29d1e4c177ddfdbd67f9774eb336)
+++ uspace/app/sbi/src/os/helenos.c	(revision 5db9084cb9b925c6758f4bc0fac5c31d7125ff35)
@@ -105,4 +105,5 @@
 {
 	char *line;
+	int rc;
 
 	if (tinput == NULL) {
@@ -112,7 +113,15 @@
 	}
 
-	line = tinput_read(tinput);
-	if (line == NULL)
+	rc = tinput_read(tinput, &line);
+	if (rc == ENOENT) {
+		/* User-requested abort */
+		*ptr = os_str_dup("");
+		return EOK;
+	}
+
+	if (rc != EOK) {
+		/* Error in communication with console */
 		return EIO;
+	}
 
 	/* XXX Input module needs trailing newline to keep going. */
Index: uspace/lib/clui/tinput.c
===================================================================
--- uspace/lib/clui/tinput.c	(revision 59ecd4a3b0bd29d1e4c177ddfdbd67f9774eb336)
+++ uspace/lib/clui/tinput.c	(revision 5db9084cb9b925c6758f4bc0fac5c31d7125ff35)
@@ -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 59ecd4a3b0bd29d1e4c177ddfdbd67f9774eb336)
+++ uspace/lib/clui/tinput.h	(revision 5db9084cb9b925c6758f4bc0fac5c31d7125ff35)
@@ -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
