0

I recently started using tmux (in addition to screen), both in a Linux environment and in msys2 (which is also new to me and for which I cannot install screen).

Very similar to screen, starting tmux disables the shift-PgUp scrolling (and the scroll bar in the terminal emulator). For both terminal multiplexers the Internet does provide an easy solution. In the case of tmux it is adding this setting to the configuration:

set -g terminal-overrides 'xterm*:smcup@:rmcup@'

This works fine in the Linux environment but not in msys2. $TERM is set to xterm.

Unfortunately I am not familiar (yet) with the internal details of terminals so I neither understand why this setting is necessary nor why it could fail. After all before starting tmux the msys2 terminal emulator does have this capability.

The Internet contains a lot of questions about tmux scrolling but I could not find any for this problem with msys2.

Meta

I was thinking about whether this is the most suitable site for this question (and it may well not be). So if this does not result in a sufficient answer but you have an idea where it might make more sense to ask this then feel free to let me know.

3
  • Of course it won't help but… you are not alone : unix.stackexchange.com/questions/747531/… ;-)
    – MC68020
    Commented May 4 at 17:27
  • @MC68020 That is not the same kind of scrolling. That refers to the "tmux-internal" scrolling with copy&paste. That does work for me, it is just quite annoying to have to do this every time. What I want is the <shift>-<pgup> scrolling (the scrollbar in a graphical terminal emulator). Commented May 4 at 18:23
  • @MC68020 Konsole/Plasma5/FreeBSD also gets hit by this, although I'm not at all sure it's the same problem you're hitting. Check whether it's related to vi usage. After ssh-ing to a Linux box, If I don't use vi, scrolling works. After I exit vi, it's hosed. vi on FreeBSD doesn't do this to me. My temp fix was gleaned from U.SE I'm pretty sure: scrollback-fix () { printf '\033\143'; } This restores Shift-PgUp and Shift-PgDn for me. WTS, I don't use tmux at all. TERM=xterm-256color
    – Jim L.
    Commented May 9 at 22:54

1 Answer 1

1

Solution:

The provided configuration snippet:

set -g terminal-overrides 'xterm*:smcup@:rmcup@'

attempts to fix this by enabling terminal mode switching for xterm-like terminals. This should theoretically allow tmux to interact with the terminal correctly. However, it's not working for msys2.

Possible Alternatives:

Alternative Scrolling Methods:

Use Ctrl-B [, Ctrl-B ] for scrolling by page in tmux mode. Consider using the arrow keys for navigating within the visible area. Investigate msys2 Terminal Settings:

Look for options in the msys2 terminal settings that might influence terminal capabilities or scrolling behavior.

1
  • Do you mean this is a known msys2 problem and not fixable (within tmux)? It works before tmux is started so I would be surprised if it cannot be fixed in the tmux config. As mentioned in the comment to my question: I am well aware of the copy mode-alternative but that is what I try to avoid. Commented May 8 at 14:03

You must log in to answer this question.

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