Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision 1352fc1a64c73092216307344dbc4766d3828889)
+++ uspace/app/edit/edit.c	(revision ba26129e20bfce4d4028c9503f848169f3d55139)
@@ -102,4 +102,7 @@
 #define ED_INFTY 65536
 
+/** Maximum filename length that can be entered. */
+#define INFNAME_MAX_LEN 128
+
 static void key_handle_unmod(console_event_t const *ev);
 static void key_handle_ctrl(console_event_t const *ev);
@@ -331,6 +334,4 @@
 }
 
-#define INPUT_MAX_LEN 64
-
 /** Ask for a file name. */
 static char *filename_prompt(char const *prompt, char const *init_value)
@@ -338,5 +339,6 @@
 	console_event_t ev;
 	char *str;
-	wchar_t buffer[INPUT_MAX_LEN + 1];
+	wchar_t buffer[INFNAME_MAX_LEN + 1];
+	int max_len;
 	int nc;
 	bool done;
@@ -349,5 +351,6 @@
 	console_set_color(con, COLOR_WHITE, COLOR_BLACK, 0);
 
-	str_to_wstr(buffer, INPUT_MAX_LEN + 1, init_value);
+	max_len = min(INFNAME_MAX_LEN, scr_columns - 4 - str_length(prompt));
+	str_to_wstr(buffer, max_len + 1, init_value);
 	nc = wstr_length(buffer);
 	done = false;
@@ -376,5 +379,5 @@
 					break;
 				default:
-					if (ev.c >= 32 && nc < INPUT_MAX_LEN) {
+					if (ev.c >= 32 && nc < max_len) {
 						putchar(ev.c);
 						fflush(stdout);
