MacOS – How to get iTerm 2 to copy only what I select

copy/pasteitermmacosterminal

iTerm2 has a very nasty habit of making an assumption of what I want to copy and paste from the terminal. Instead of just allowing me to copy exactly what I highlight, it will expand to what it considers more useful.

As an example maybe I have the following command

rsync <file> server.example.com:/home/user/<file>

If I was to select via cursor and highlight server.example.com, it will instead re-highlight the entire command and copy that. It is so annoying because I copy stuff all day long.

I copy by either pressing Command+C, or right clicking to get the dialog menu and selecting copy which is the same as doing “Edit” → “Copy”, on the toolbar.

I have disabled the automatic select text and copy function. That is something I do not want enabled.

Is there anyway to fix this?

Best Answer

If you do a double-click to select it go into "all-word" mode, which automatically grabs each word.

If you just click and drag it'll take whatever your selection is.