How do I disable pastying into my xterm?

2

Many times I have accedentally pasted into my Xterm window, with the result that whatever text is pasted in is executed by my shell (zsh). I would like to know if I can disable pasting into Xterm.

Edit: it is my middle mouse button that is doing the pasting. I would rather avoid pasting into the Xterm with my mouse, since Ctrl - Shift - V is both faster and less error-prone.

Demi

Posted 2014-02-25T22:35:02.190

Reputation: 718

1I suppose you still want to paste in other locations? Have you considered simply re-mapping, or un-mapping the paste button? – Zoredache – 2014-02-25T23:08:10.827

@Zoredache How would one do this? The paste button is the middle mouse button. – Demi – 2014-03-07T17:06:13.507

Answers

1

The solution was the safe-paste plugin for oh-my-zsh. This prevents anything pasted from being executed until I hit enter, so I can Ctrl-C and discard what I pasted.

Edit: This apparently does not work completely, because I could paste text (containing an embedded escape sequence) that would fool zsh. So I am back to the original question: How do I disable entirely pasting into my Xterm with the mouse? (The solution in general is to first look at everything in a text editor, but I want to avoid accidental pasting).

Demi

Posted 2014-02-25T22:35:02.190

Reputation: 718