Can’t iTerm2 open files with touch screen scroll under mac?

  question, vim

Mac’s Terminal uses Vim to open the file. If the file has multiple screens, you can scroll with the touchpad to view the code easily.
However, if you open files with iTerm2, you cannot scroll with the touch screen. What is going on?
How do I set it so that I can scroll with the touch screen under iTerm2?

After searching for a long time, we finally found a solution.
~/.vimrc add the following line

set mouse=a