Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision 059a8e4b4f97d287fdb888636dac0f59bfafa019)
+++ kernel/generic/src/console/kconsole.c	(revision 1e01a353860b7e227c355a8a681a76dac240bfd7)
@@ -201,12 +201,21 @@
  *
  */
-NO_TRACE static int cmdtab_compl(char *input, size_t size)
+NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t * indev)
 {
 	const char *name = input;
 	
 	size_t found = 0;
+	/* Maximum Match Length : Length of longest matching common substring in
+	   case more than one match is found */
+	size_t max_match_len = size;
+	size_t max_match_len_tmp = size;
+	size_t input_len = str_length(input);
 	link_t *pos = NULL;
 	const char *hint;
 	char *output = malloc(MAX_CMDLINE, 0);
+	char display = 'y';
+	size_t hints_to_show = MAX_TAB_HINTS - 1;
+	size_t total_hints_shown = 0;
+	char continue_showing_hints = 'y';
 	
 	output[0] = 0;
@@ -218,4 +227,12 @@
 		pos = pos->next;
 		found++;
+	}
+	
+	/* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */
+	if (found > MAX_TAB_HINTS) {
+		printf("\nDisplay all %zu possibilities? (y or n)", found);
+		do {
+			display = indev_pop_character(indev);
+		} while (display != 'y' && display != 'n' && display != 'Y' && display != 'N');
 	}
 	
@@ -225,7 +242,43 @@
 		while (cmdtab_search_one(name, &pos)) {
 			cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link);
-			printf("%s (%s)\n", hlp->name, hlp->description);
+
+			if (display == 'y' || display == 'Y') { /* We are still showing hints */
+				printf("%s (%s)\n", hlp->name, hlp->description);
+				--hints_to_show;
+				++total_hints_shown;
+
+				if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */
+					printf("--More--");
+					do {
+						continue_showing_hints = indev_pop_character(indev);
+						if (continue_showing_hints == 'y' || continue_showing_hints == 'Y'
+								|| continue_showing_hints == ' ') {
+							hints_to_show = MAX_TAB_HINTS - 1; /* Display a full page again */
+							break;
+						}
+
+						if (continue_showing_hints == 'n' || continue_showing_hints == 'N'
+								|| continue_showing_hints == 'q' || continue_showing_hints == 'Q') {
+							display = 'n'; /* Stop displaying hints */
+							break;
+						}
+
+						if (continue_showing_hints == '\n') {
+							hints_to_show = 1; /* Show one more hint */
+							break;
+						}
+					} while (1);
+
+					printf("\r         \r"); /* Delete the --More-- option */
+				}
+			}
+
 			pos = pos->next;
-		}
+			for(max_match_len_tmp = 0; output[max_match_len_tmp] == hlp->name[input_len + max_match_len_tmp]
+					&& max_match_len_tmp < max_match_len; ++max_match_len_tmp);
+			max_match_len = max_match_len_tmp;
+		}
+		/* keep only the characters common in all completions */
+		output[max_match_len] = 0;
 	}
 	
@@ -294,23 +347,15 @@
 			if (beg == 0) {
 				/* Command completion */
-				found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE));
+				found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev);
 			} else {
 				/* Symbol completion */
-				found = symtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE));
+				found = symtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev);
 			}
 			
 			if (found == 0)
 				continue;
-			
-			if (found > 1) {
-				/* No unique hint, list was printed */
-				printf("%s> ", prompt);
-				printf("%ls", current);
-				print_cc('\b', wstr_length(current) - position);
-				continue;
-			}
-			
-			/* We have a hint */
-			
+
+			/* We have hints, may be many. In case of more than one hint,
+			   tmp will contain the common prefix. */
 			size_t off = 0;
 			size_t i = 0;
@@ -320,4 +365,15 @@
 				i++;
 			}
+			
+			if (found > 1) {
+				/* No unique hint, list was printed */
+				printf("%s> ", prompt);
+				printf("%ls", current);
+				position += str_length(tmp);
+				print_cc('\b', wstr_length(current) - position);
+				continue;
+			}
+			
+			/* We have a hint */
 			
 			printf("%ls", current + position);
@@ -540,5 +596,5 @@
 /** Parse command line.
  *
- * @param cmdline Command line as read from input device. 
+ * @param cmdline Command line as read from input device.
  * @param size    Size (in bytes) of the string.
  *
