6

Sometimes whenever I use my mouse to scroll on iTerm2 the scrolling does not work, instead printing a lot of garbage characters on the screen.

enter image description here

This happens very inconsistently. Sometimes it happens abruptly, and sometimes it doesn't happen for months. At first I thought it is just a bug, but it even happens just after I restart my machine, and also I could not find other people experience this problem that much on the web. So maybe something is wrong with my environment...

This does not happen on Mac's default Terminal and happens on various Macs I have. Also, quitting and launching the app again does not solve the problem.

What is the potential reason of this behavior and how can I fix it? I use Big Sur 11.0.1 but it happened on other macOS in the past. iTerm2 is 3.4.3.

2 Answers 2

7

This was driving me bananas as well. I noticed that it only seemed to happen in a shell - which led me to install the iTerm2 shell integration, and after a restart of the shell, viola! No more garbage on click and scroll!

Either click iTerm2 -> Install Shell Integration in the top menu, or run the command manually:

curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | bash

ref iTerm2 Shell Integration

1

Mouse Reporting mode might be ON.

Turn it off by:

  • Right click on the terminal
  • Choose Terminal State
  • Turn off Mouse Reporting

Mouse Reporting should be unchecked.

enter image description here

Update

As mentioned in the comment on this answer, you can disable Visual Mode by holding down the Option key while you are selecting the text.

Enable mouse reporting

If selected, applications may choose to receive information about the mouse. This can be temporarily disabled by holding down Option.

https://iterm2.com/documentation-preferences-profiles-terminal.html#:~:text=Enable%20mouse%20reporting

1
  • 1
    If you want disable temporarily you can hold down "Option" while scrolling (Ref: iterm2.com/…)
    – Rothin Sen
    Sep 18 at 12:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .