x=$(</dev/stdin)
note that this will strip trailing newlines. I use this trick to avoid the loss:
x=$(</dev/stdin; printf .)
x=${x%.}
Holding Shift while dragging the mouse doesn’t make a difference. It makes a selection in the same way that just dragging the mouse does. I can work on that selection in kakoune, but Cmd+C doesn’t do anything
I think you can disable “Mouse Reporting” to allow the terminal to make selections. (Personally I haven’t needed it since I fixed my OSC 52 copy script.)
When typing Command+C, iTerm2 actually asks you to (temporarily) disable Mouse Reporting, very nice UX