tmux: ncurses apps are displayed wrong (with garbage and so on)

5,201

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!
Share:
5,201

Related videos on Youtube

Dmitry Frank
Author by

Dmitry Frank

I'm a passionate software engineer with strong background in low-level parts (MCU real-time kernels, C, Assembler), and experienced in higher-level technologies as well: Go, C++, JavaScript, and many others. Author of the well-formed and carefully tested real-time kernel for 16- and 32-bit MCUs: TNeo, which is now used by several companies. One of my hobby projects is a geeky bookmarking service written in Go and PostgreSQL: Geekmarks. Some of my articles: How I ended up writing a new real-time kernel How do JavaScript closures work under the hood Unit-testing (embedded) C applications with Ceedling Object-oriented techniques in C See more at dmitryfrank.com

Updated on September 18, 2022

Comments

  • Dmitry Frank
    Dmitry Frank 2 months

    I have ncurses apps (say, aptitude) working nice in plain xterm (or gnome-terminal, or any other terminal I've tried), but if I run it inside tmux session, screen isn't properly refreshed while I do some navigation through the menu.

    Example screenshot: aptitude qinside tmux

    (full resolution: http://i.imgur.com/jKLCX3A.png)

    The same happens with other ncurses apps inside tmux: say, cgdb. And again, without tmux they work nice.

    How to make it work correctly in tmux too?

    (OS is Linux Mint 13, if that does matter)

  • Dmitry Frank
    Dmitry Frank over 8 years
    Thanks, as I just found out after your answer, my tmux config was actually correct (setting TERM to screen-256color), but for some reason this setting is overrided by one in the ~/.zshrc, so TERM is finally set to xterm-256color. I'd be very glad if you take a look at my related question unix.stackexchange.com/questions/139082/…