Add a key binding action to send selection as input to a command [was: under tmux, Multiline mouse-select of wrapped text SOMETIMES includes newlines (without rich text enabled)]
Under tmux, sometimes (not always), I'm observing that Multiline mouse-select of wrapped text includes newlines.
It's unfortunately hard to reproduce, since when I paste the offending code on a text editor, then manually remove the newlines, then paste it in a fresh new tab with a fresh tmux (whether split or not), then redo the multiline mouse select there, it doesn't exhibit the bad behavior. But in the original window, it still does. I just don't know how to send you a reproducible use case; but I hope you could spot a bug in the code that does line un-wrapping?
NOTE:I've been having this issue for at least 2 years and reported it on the old issue tracker. NOTE:I have "selection respects soft boundaries" but it should be irrelevant since I'm observing this even for vertical split.
NOTE:Related but different:#3535 (closed) [ Multiline mouse-select of wrapped text / paste includes newlines, if rich text is enabled] (since here I don't enable rich text)
This is a DANGEROUS bug as it can create havoc when pasting the resulting multiline in iterm2: (extreme example but there are many real case problems i had in the past) 'echo some long wrapped line that contains rm -r /my_important_project somewhere' if the user pastes this wrapped line and a newline is inserted in the middle, it'll execute something unintended.
So that often makes me first paste in an editor, remove the newlines, and paste back in iterm2
Thanks!!