Index: release/scripts/startup/bl_ui/space_console.py =================================================================== --- release/scripts/startup/bl_ui/space_console.py (revision 46372) +++ release/scripts/startup/bl_ui/space_console.py (working copy) @@ -42,6 +42,7 @@ layout = self.layout layout.operator("console.clear") + layout.operator("console.delete", text="Empty current line").type = "ALL" layout.operator("console.copy") layout.operator("console.paste") layout.menu("CONSOLE_MT_language") Index: source/blender/editors/space_console/console_ops.c =================================================================== --- source/blender/editors/space_console/console_ops.c (revision 46372) +++ source/blender/editors/space_console/console_ops.c (working copy) @@ -436,6 +436,7 @@ {DEL_PREV_CHAR, "PREVIOUS_CHARACTER", 0, "Previous Character", ""}, {DEL_NEXT_WORD, "NEXT_WORD", 0, "Next Word", ""}, {DEL_PREV_WORD, "PREVIOUS_WORD", 0, "Previous Word", ""}, + {DEL_ALL, "ALL", 0, "All", ""}, {0, NULL, 0, NULL, NULL} }; @@ -486,6 +487,13 @@ } } break; + case DEL_ALL: + console_history_add(C, ci); + console_history_add(C, NULL); + sc->sel_start = 0; + sc->sel_end = 0; + done = 1; + break; } if (!done) { @@ -570,8 +578,10 @@ { SpaceConsole *sc = CTX_wm_space_console(C); ARegion *ar = CTX_wm_region(C); + int done = 0; + int pos; - ConsoleLine *ci = console_history_verify(C); /* TODO - stupid, just prevernts crashes when no command line */ + ConsoleLine *ci = console_history_verify(C); /* TODO - stupid, just prevents crashes when no command line */ short reverse = RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */ int prev_len = ci->len; @@ -584,7 +594,7 @@ console_history_free(sc, ci_prev); } - if (reverse) { /* last item in mistory */ + if (reverse) { /* last item in history */ ci = sc->history.last; BLI_remlink(&sc->history, ci); BLI_addhead(&sc->history, ci); @@ -606,6 +616,13 @@ ci = sc->history.last; console_select_offset(sc, ci->len - prev_len); + // Always place cursor at the end of line (needed after DEL_ALL) + pos = ci->cursor; + BLI_str_cursor_step_utf8(ci->line, ci->len, + &pos, STRCUR_DIR_NEXT, + STRCUR_JUMP_ALL); + done = console_line_cursor_set(ci, pos); + /* could be wrapped so update scroll rect */ console_textview_update_rect(sc, ar); ED_area_tag_redraw(CTX_wm_area(C)); Index: source/blender/editors/space_console/space_console.c =================================================================== --- source/blender/editors/space_console/space_console.c (revision 46372) +++ source/blender/editors/space_console/space_console.c (working copy) @@ -312,6 +312,8 @@ RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", DELKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_NEXT_WORD); RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_PREV_WORD); + RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", YKEY, KM_PRESS, KM_CTRL, 0)->ptr, "type", DEL_ALL); + #ifdef WITH_PYTHON WM_keymap_add_item(keymap, "CONSOLE_OT_execute", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */ WM_keymap_add_item(keymap, "CONSOLE_OT_execute", PADENTER, KM_PRESS, 0, 0);