Skip to content

Process text from drag & drop the same as paste

Koichi Murase requested to merge akinomyoga/konsole:bracketed-drop-text into master

Is this the right place to submit a patch to Konsole? Please let me know if this is not the place or if I need to first open a ticket in Bugzilla before creating a merge request.

Currently, the text dragged and dropped in the Konsole window is directly written to the PTY. This means it bypasses all the sanitizations of control characters and newline conversions that are applied to the pasted text. I believe these processes (sanitizations and conversions) should also be applied to the dropped text as well. In particular, the newlines in the original text encoded as \n, if not converted to \r (RET), are translated to Ctrl-J by typical user-input decoders and can cause problems when the terminal application assigns different meanings to RET (Ctrl-M) and Ctrl-J. I think it is also reasonable to quote the dropped text by the bracketed-paste markers when the bracketed paste mode is turned on.

In this merge request, doPaste is used to pass the dropped text to the terminal applications instead of writing the raw bytes of the dropped text to the PTY.

Edited by Koichi Murase

Merge request reports