MacOS – the difference between these two cursors, with tmux
itermmacostmux
When running iTerm2 / Tmux, I have this cursor:
but when I hold the alt/option key, I have this cursor:
what is the difference?
Best Answer
Normally when you for example select a piece of text in iTerm2, your mouse activity is reported to the application you're currently running (for example a text editor). That application decides what happens.
However, when you hold down the alt/option key in iTerm2, you disable mouse reporting. This means that the application is not told of your mouse movements, and instead everything takes place inside iTerm2.
This can be used if for example you want to select and copy a piece of text to the macOS clipboard, but the application you're running does not allow you to do so (i.e. it has some other behavior triggrered by the mouse).
The setting in iTerm2 affects two things:
1. How the TERM environment variable is initially set. Your login scripts are changing this if it gets set to screen (or you're using screen or tmux, which always set it to screen)
2. The "ansi" terminal automatically scrolls when the cursor is on the bottom right of the screen. You probably don't want this.
As for how the TERM var is interpreted by apps, that's complicated. Most people want xterm-256color unless they're sshing to a host that doesn't support it. In order of capability and support, I'd order them:
xterm-256color
xterm-new
xterm
vt100
I probably wouldn't use the others unless I had a really good reason to (they're carried over from the original iTerm code and may or may not work well).
Anyway, figure out why your TERM var is getting changed to screen and that's probably the cause of your trouble.
Best Answer
Normally when you for example select a piece of text in iTerm2, your mouse activity is reported to the application you're currently running (for example a text editor). That application decides what happens.
However, when you hold down the alt/option key in iTerm2, you disable mouse reporting. This means that the application is not told of your mouse movements, and instead everything takes place inside iTerm2.
This can be used if for example you want to select and copy a piece of text to the macOS clipboard, but the application you're running does not allow you to do so (i.e. it has some other behavior triggrered by the mouse).