The console does a lot of things right, like auto-complete using ctrl+space and storing a
history of the most recent unique line entries. Internally the history behaves like a set, if a line exists in the history it does not get added.
There are some things that the console doesn't do
In the meantime i poked around in bpy to see what is already exposed to python, just in case a c-patch is beyond my brainpower or is rejected.
There are some things that the console doesn't do
- allow kb shift + cursor to set a selection
- allow key combo at end of line to copy current line
- allow key combo to copy last n entries in history
In the meantime i poked around in bpy to see what is already exposed to python, just in case a c-patch is beyond my brainpower or is rejected.
[lines.body for lines in bpy.context.area.spaces.active.history][:4]
naive method 1
That displays the last 4 unique history entries in the console. But the problem is that active state might not be available if running as a operator script. We'll see. Too warm to really think here atm.Not sure if there are neater ways to do this, but this will keep me going for a while. Will have to add a few options like copy 2 / 4 / 6 / 12 lines to clipboard. Right now it is hardcoded to 4. This script gets added as Console View -> Console (button) -> Copy History