diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index ad0921fa3..81af01f10 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -131,18 +131,19 @@ end function run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback) local theme = beautiful.get() if not args then args = {} end - local command = "" + local command = args.text or "" local command_before_comp local cur_pos_before_comp local prettyprompt = args.prompt or "" local inv_col = args.fg_cursor or theme.fg_focus or "black" local cur_col = args.bg_cursor or theme.bg_focus or "white" local cur_ul = args.ul_cursor + local text = args.text or "" history_check_load(history_path, history_max) local history_index = history_items(history_path) + 1 -- The cursor position - local cur_pos = 1 + local cur_pos = text:len() + 1 -- The completion element to use on completion request. local ncomp = 1 if not textbox or not exe_callback then