New Add-on: Console text editing improvements

move cursor under mouse clic and with selections:
so you can insert text everywhere overwrite a selection
same with ctrl x, ctrl v, suppr, backspace
Now an undo Ctrl+Z and a redo shift+ctrl+Z in the console!
add ctrl Q: quick favorite


This is awesome! Why not submit it as a patch to be integrated into master?


I don’t know how to do
The change doesn’t seem to be large enough for an add-on, so the source code is at release/scripts/startup/bl_ui/ & source/blender/editors/space_console/console_ops.c

Upload a patch, keep improving it using arcanist [1] & add a reviewer.
Feel free to ask for help at



ok thks I will watch this

I added a Ctrl V to paste over a selection if exists. and same to cut a selection
writing on a selected word is writing at the end of the word where the cursor is, by default.
but I did a script to write over selection too but I can’t do bpy.ops.console.insert(‘INVOKE_DEFAULT’)
in the C file related to console operators they are telling they only considered the situation or the invoke would be called from a key and not from a script. Apparently not a bug but I don’t know where to ask. really accessing this part is like a wall for me

For the record, I just commented out the bpy.ops.console.insert('INVOKE_DEFAULT') lines and replaced the return value with {'PASS_THROUGH'} and it worked.

class CONSOLE_OT_Insert(bpy.types.Operator):
    bl_idname = "console.easy_insert"
    bl_label = "console easy insert"

    def poll(cls, context):
        return context.area.type == 'CONSOLE'

    def execute(self, context):

        sc = context.space_data
        st, se = (sc.select_start, sc.select_end)
        if st == se:
            # bpy.ops.console.insert('INVOKE_DEFAULT')
            for _ in range(se-st):
                for _ in range(st):
            sc.select_start = st
            sc.select_end = st
            # bpy.ops.console.insert('INVOKE_DEFAULT')

        return {'PASS_THROUGH'}
1 Like