Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
I have realised that this happens regardless of being in an SSH connection or not. So SSH does not seem to be part of the problem. This brings it down to tmux, or my shell, I'm guessing. – eoinoc Sep 17 '12 at 11:16
The shell doesn't matter. SSH was the most likely culprit (an unknown terminal type on the server), but that's not it… What's the value of TERM inside tmux (echo $TERM in the shell inside tmux)? Also, does echo $LINES return the correct number of lines? If you have a .tmux.conf, try without, and if it's the culprit, post its content. – Gilles Sep 17 '12 at 22:56
The value of TERM is xterm-256color. Lines says 39 (hmm, does that mean columns or rows?). Right you are, moving .tmux.conf fixes the issue, so I'm putting the contents above. – eoinoc Sep 18 '12 at 19:58
tmux uses screen-256color by default. Changing TERM to something else within tmux may have unintended consequences. Make sure the terminfo entry for screen-256color is present on your system. – jw013 Sep 18 '12 at 20:06
I ended up with the value of screen for tmux, as screen-256color ended up with nano failing to launch during SSH sessions with the error: Error opening terminal: xterm-256color. – eoinoc Sep 24 '12 at 14:19
up vote 4 down vote accepted

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.                                                           *


share|improve this answer
Set value to screen specifically, as screen-256color resulted in the error Error opening terminal: xterm-256color launching nano during SSH sessions. – eoinoc Sep 24 '12 at 14:20
1+ Lifesaver! Made the switch from screen just now and this problem was bugging me big time. – user13742 Oct 31 '12 at 22:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.