Mouse thinks it is in a different tmux pane - tmux

I am using tmux 3.0 in bash over ssh on CentOS 7. My tmux.conf is fairly simple. It has some bindings and
set-option -g mouse on
set -g focus-events on
I have a fairly large tmux window with 3 vertical panes. When I move the mouse to the right side of the rightmost pane and do something (e.g. scroll with mouse wheel or click to select this pane). The action gets executed on the leftmost pane instead.
This behavior persists if I detach from and reattach to the session. Any ideas what might be causing this and how to fix it?

Terminal emulators which do not support SGR mouse mode will not correctly report any mouse actions to the right of column 227. Is your terminal emulator window wider than this?
Try using a different terminal emulator.

Related

tmux within guake eats my scrollback buffer

I want to run tmux within guake, then start a long command, hide guake, and bring it back to access the whole output.
But when I hide guake then show it back, I can no longer scroll to the beginning : I seem to scroll up only to the point where the output was when I brought back the guake window.
I do not have this scrolling issue when running my command in guake alone, or when running tmux through a basic terminal like gnome-terminal.
How can I toggle tmux visibility with guake, while still preserving my scrollback?
my tmux settings:
set -g mouse on
bind -n Pageup copy-mode -u

How does one set the mouse on a remote HPC?

I am running tmux on a remote HPC but the mouse scrolling for history does not work. I know it usually works if one does:
C-b :
to get into command mode. Then:
setw -g mouse on
to turn the mouse on. But when I do that it doesn't like it:
Ambiguous option: mouse
Is this not possibel? How do I do it?
related: https://superuser.com/questions/210125/scroll-shell-output-with-mouse-in-tmux
For me, on tmux v1.8, the following command worked:
set -g mode-mouse on
Other mouse related excerpts from man tmux :
mouse-resize-pane [on | off]
If on, tmux captures the mouse and allows panes to be resized by dragging on their
borders.
mouse-select-pane [on | off]
If on, tmux captures the mouse and when a window is split into multiple panes the
mouse may be used to select the current pane. The mouse click is also passed
through to the application as normal.
mouse-select-window [on | off]
If on, clicking the mouse on a window name in the status line will select that win‐
dow.
mouse-utf8 [on | off]
If enabled, request mouse input as UTF-8 on UTF-8 terminals.
.
.
.
mode-mouse [on | off | copy-mode]
Mouse state in modes. If on, the mouse may be used to enter copy mode and copy a
selection by dragging, to enter copy mode and scroll with the mouse wheel, or to
select an option in choice mode. If set to copy-mode, the mouse behaves as set to
on, but cannot be used to enter copy mode.

In tmux, can I show pane titles only when there are multiple panes?

I use tmux all the time, but I only use multiple panes in about 20% of my many tmux windows, and the pane status line showing up when there is only one pane is not helpful to me. I would like to only see it when there are multiple panes, including when I'm zoomed in on one of them (thus reminding me that there are others).
Can I achieve this with any released versions of tmux? (3.2a at the moment, but if it becomes available in later versions I'm of course still interested in knowing about it.)
Try adding this to your .tmux.conf:
set-hook -g -w pane-focus-in "set-option -Fw pane-border-status '#{?#{e|>:#{window_panes},1},top,off}'"
It will create a hook that runs on the pane-focus-in event, which calls set-option for pane-border-status.
The final parameter to set-option is a format string containing a conditional such that, if the current window has more than one pane (#{window_panes} > 1), pane-border-status is set to the value top; else, it is set to the value off.
When I test this, windows with a single pane have no pane border/title. When one or more additional panes are created, the border appears:

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.

how to disable the scroll function when I use the 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.

Resources