how to disable the scroll function when I use the tmux? - tmux

Tmux uses the scroll to find the history commands which bothers me too much.
How to disable this function? I have tried to use "set mouse on", but it gives me another problem. I just want to disable my mouse all the time, with the scroll leaves its original usage.

Tmux no longer has multiple options for mouse mode, there is just mouse on or off (assuming a recent version of tmux).
If you want to use the mouse, including the scroll wheel, for anything except scrolling history, mouse mode must be on (set -g mouse on). Turning on the mouse should not prevent you from not using your mouse to accomplish things; the default tmux key functionality remains.

Related

How can I enter the copy mode when I scroll the mouse while using Tmux in MinTTY?

Scrolling the mouse while using Tmux in MinTTY, the command history is scrolled.
It seems that MinTTY converts mouse scroll event to up/down key.
In the past, I tried the following terminal with tmux2.1 or later,
the terminal was automatically set to copy mode.
iTerm2
WindowsTerminal
The .tmux.conf options are all the same.
set -g mouse on
I want to stop sending up/down key when I scroll the mouse while using Tmux in MinTTY.
And if possible, I want to enter copy mode automatically like other terminals.
Current Environment:
Ubuntu20.04 on WSL2
MinTTY3.06(WslTTY,GitBash)
temporary solution:
I want to stop sending up/down key when I scroll the mouse while using Tmux in MinTTY.
add this line to ~/.mintty
SuppressMouseWheel=scrollapp
I want to enter copy mode automatically like other terminals.
Shift + MousuWheel worked.
Shift may depend on the [Options->Mouse->Modifier for overriding default] setting.

tmux use mouse only to resize panes

In new versions of tmux, I know that I can use set -g mouse on to enable mouse support in order to be able to resize panes with the mouse.
But it also enable a feature that I do not want which is using copy mode when I select text in the terminal. In that way I am no more able to copy text in the system clipboard in order to paste it outside of tmux.
My question is: is there a way to enable resizing panes with the mouse, which very handy, without having to enable mouse support for other things?
Because there in no answer, I will try to answer myself:
Apparently there is no way to do this, since when a mouse event is intercepted by tmux, it cannot be forwarded to the system. I say this but it is pure deduction, I have no knowledge about that.
As an alternative, there is a way to prevent tmux to intercept the mouse, by holding a key like "fn" on Mac OS.

Tmux and copy mode with release mouse button

I'm using tmux for the first time as a replacement for iterm (mostly because of the split panels function) and it works great. Now, i have a question about the copy-text behaviour.
It's possible to configure tmux, so i can select text with the left button (in copy mode) and it's automatically copied (to the clipboard) when i release the left button? (same as in irc clients)
Tmux’s select behavior will depend on your mouse settings. If mode-mouse is off, Tmux should stay out of the way. But, by default, it may be set to “on”. Then it will use its own “paste buffer”. To bypass that, you can hold down shift while selecting and pasting. (This works on Linuxes, but probably on Mac, too; not sure what OS you’re on.)

Tmux current pane indicator when focus regained

I'm trying to create a visual indicator of which pane is currently focused in tmux when my terminal (iterm2, OSX) window gains focus. I have found that iterm2 sends a focus gained escape sequence (^[[I) so now I am trying to find how I can capture that and fire the prefix q command which shows pane numbers with the active pane in red.
Any ideas on how to capture the escape sequence in tmux OR in iterm2?
I have a partial solution to my issue which takes a different approach. Since I usually have vim and one terminal pane open, dimming vim when it is not focussed is a good indicator which pane is active. In order to achieve this I have modified the vim-diminactive plugin to react to focus events (https://github.com/blueyed/vim-diminactive/pull/8), this requires the Vitality.vim plugin as well as enabling (focus-events) in tmux options.
In order to completely solve my issue I am working on changing the background colour of terminal panes when they lose focus. I use zsh so I can capture the focus event with bindkey (I have verified this works) to issue a background colour change escape code to iterm2, however this seems to have no effect in tmux.

How does vim detect and handle mouse scroll when started in XTerm?

Is there an app that can handle mouse scroll in xterm, other than vim? I wanted to scroll man pages and less won't handle mouse scroll but why is it that vim can? Is this because of curses?
Curses does infact have mouse support. If I remember right wheel-up is button 4 and wheel-down is button 2. It may be system / terminal dependent, I'm not sure.
As for what other apps make use of this feature, midnight commander and ranger come to mind.

Resources