Fix Scrolling in Nano Running in Tmux on Mate-Terminal

nanoterminaltmuxzsh

The problem:

  • I open a terminal (in Linux Mint, so mate-terminal)
  • zsh is the shell
  • Then I run tmux
  • Edit a file with nano
  • Scroll up and down that file with the cursor
  • Issue: When scrolling down in nano, only the bottom half of the terminal window gets refreshed
  • Issue: When scrolling up in nano, only the top half of the terminal windo
    gets refreshed

The complete nano view of file does not get refreshed in my terminal window when scrolling. Any tips?

Edit: my .tmux.conf

It seems that this line specifically is the culprit (as commenting it out fixes the problem):

set -g default-terminal "xterm-256color"

I'm pretty sure I added that line because I have issues even running nano during an SSH session.

Here is the full file:

set-option -g default-shell /bin/zsh

# Make sure tmux knows we're using 256 colours, for
# correct colourised output
set -g default-terminal "xterm-256color"

# The following were marked as "unknown", so
# I do know what I'm doing wrong.
#set -g mode-mouse on
#setw -g mouse-select-window on
#setw -g mouse-select-pane on

# Attempting to stop "alert" sound upon startup
# but none of these are working...
set-option bell-on-alert off
set-option bell-action none
set-option visual-bell off

Best Answer

From the tmux FAQ:

******************************************************************************
* PLEASE NOTE: most display problems are due to incorrect TERM! Before       *
* reporting problems make SURE that TERM settings are correct inside and     *
* outside tmux.                                                              *
*                                                                            *
* Inside tmux TERM must be "screen" or similar (such as "screen-256color").  *
* Don't bother reporting problems where it isn't!                            *
*                                                                            *
* Outside, it must match your terminal: particularly, use "rxvt" for rxvt    *
* and derivatives.                                                           *
******************************************************************************

http://tmux.git.sourceforge.net/git/gitweb.cgi?p=tmux/tmux;a=blob;f=FAQ

Related Question