13

Every time when opening an new Terminal window, the View -> Allow mouse reporting is always checked. And everytime i must press CMD-R to disable it.

enter image description here

Is here a way how to disable it by default?

0

4 Answers 4

12

The View > Allow Mouse Reporting menu item does not enable the terminal Mouse Reporting behavior, it merely controls whether Mouse Reporting is allowed.

This gives the user a means to temporarily bypass Mouse Reporting when it has been enabled by application programs, to interact with the terminal view for short periods of time. Also note that you can use the Fn modifier key when clicking, dragging and scrolling to temporarily bypass Mouse Reporting.

Mouse Reporting is not enabled unless application programs running within the terminal request it. Application programs normally do not enable it by default, and must be configured to do so. For example, to enable Mouse Reporting in Vim, one puts set mouse=a into ~/.vimrc.

If you do not want Mouse Reporting to be enabled, configure the appropriate application program(s) to disable it.

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – bmike
    Apr 10, 2020 at 16:18
6

This bug can be worked around by default via an osascript command in your shell startup config (e.g. ~/.zshrc or whatever):

osascript -e 'tell application "System Events" to keystroke "r" using command down'

though this may need if statements to check if a) TERM_PROGRAM is Apple_Terminal and b) perhaps not if sshing in from a not-Mac-using-Terminal.app to a Mac.

3
  • What motivated you to do all of this instead of disabling mouse reporting in the application you’re using within the terminal? No program should enable mouse support by default. Are sysadmins configuring applications to enable it for all users? Is it common for users to enable mouse support in applications and forget that they did it and how to turn it off?
    – Chris Page
    May 3, 2020 at 11:59
  • I have hit this bug twice in the last week. I really don't want to have to track down why it's happening each individual time. It looks like Ubuntu ships a vim that enables this by default (including over ssh); and somehow mysteriously (perhaps vim is buggy, perhaps something else?) it has also ended up enabled at my shell prompt on the remote system, which obviously just spams gibberish since the shell doesn't understand the escapes. I just want this "feature" to go away. Aug 30, 2021 at 17:45
  • @ChrisPage whatever is "supposed" to be aside i'm also experiencing the mouse reporting and will be using this answer Sep 25, 2021 at 3:58
4

Important semantics aside, it would still be really nice, for at least some of us, to change the default behavior; to disallow Mouse Reporting. (This was a change in behavior, and can get in the way.)

So I created a silly little AppleScript, which now saves me that bother; it's below. Personally, I saved the script as an app, and invoke it via QuickSilver.

(Maybe there are better ways - I'd love to know.)

I was able to find no way to integrate this workaround, directly with Terminal; for example, to replace the default behavior. It can easily be added to the Script menu - though apparently items here, are not eligible for command key equivalents, as may be configured in the "Shortcuts" tab of the "Keyboard" pane of System Preferences. (Indeed, I was unable to affect the "New Window with Profile - " menu item at all.)

AppleScript below:

tell application "Terminal"
    activate
    tell application "System Events" to keystroke "n" using command down
    tell application "System Events" to keystroke "r" using command down
end tell
5
  • “It can easily be added to the Script menu - though apparently items here, are not eligible for command key equivalents” If you could, why would you install this script and add a keyboard shortcut to run it instead of using the existing keyboard shortcut on the Allow Mouse Reporting menu item?
    – Chris Page
    May 3, 2020 at 11:48
  • What motivated you to do all of this instead of disabling mouse reporting in the application you’re using within the terminal? No program should enable mouse support by default. Are sysadmins configuring applications to enable it for all users? Is it common for users to enable mouse support in applications and forget that they did it and how to turn it off?
    – Chris Page
    May 3, 2020 at 11:59
  • 1
    all I know, is behavior changed, in a way that was problematic for my workflow; the underlying philosophy is (at least right now) less important to me, than being able to move on, and get more pressing things done.
    – mvgfr
    May 5, 2020 at 19:39
  • 1
    regarding the script menu: I was unclear; what I had intended to say, was: (and again, for a workaround) that I wanted to use a script to take over the behavior of cmd-N (for new window) such that it would create a new window AND uncheck "Allow Mouse Reporting" (every time, by default)
    – mvgfr
    May 5, 2020 at 19:41
  • Oh, I see how that makes sense as a workaround.
    – Chris Page
    May 6, 2020 at 9:36
1

In Iterm2 you can enable/disable mouse reporting in preferences

enter image description here

You must log in to answer this question.

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