Menu

#2898 console doesn't handle <<PasteSelection>>

obsolete: 8.6b1.1
open
5
2011-04-30
2011-04-30
Andy Goth
No

The <<PasteSelection>> event isn't properly handled by console. It just inserts the text wherever the mouse pointer is, even though this can corrupt the displayed history. Or, pasting to the "right" location by pointing at the insertion cursor, sometimes fails to put the text into the input buffer. This handler is inherited from the text widget.

<<PasteSelection>> is generated by middle-clicking (<ButtonRelease-2>), according to tk.tcl.

One possible approach is to handle <<PasteSelection>> in the same way as <Insert>, disregarding mouse pointer position. Another is to attempt to position the insertion cursor to the pointer position but to constrain it to the input line before inserting, the same as clicking and typing.

Discussion