neomutt icon indicating copy to clipboard operation
neomutt copied to clipboard

neomutt doesn't redraw index correctly in tmux when TERM=tmux-256color

Open hiecaq opened this issue 6 years ago • 2 comments

Expected Behaviour

When quitting from pager, the index displayed in pager (via set pager_index_lines) should be correctly redrawn.

Actual Behaviour

The index lines covered in pager as pager_index_lines are screwed up, and calling redraw doesn't help.

Steps to Reproduce

Run neomutt inside tmux when $TERM=tmux-256color, with the following related config for neomutt:

set pager_index_lines = 10

My terminfo for tmux-256color:

tmux|tmux terminal multiplexer,
  ritm=\E[23m, rmso=\E[27m, sitm=\E[3m, smso=\E[7m, Ms@,
  use=xterm, use=screen,
  kbs=\177,

tmux-256color|tmux with 256 colors,
  use=xterm-256color, use=tmux,
  kbs=\177,

Envs:

$ echo $TERM
tmux-256color
$ echo $PAGER
less

How often does this happen?

  • Always

When did it start to happen?

I just installed and started to use neomutt so I'm not sure since when this behavior exists.

NeoMutt Version

NeoMutt 20180716
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 4.20.13-arch1-1-ARCH (x86_64)
ncurses: ncurses 6.1.20180127 (compiled with 6.1.20180127)
libidn2: 2.1.1 (compiled with 2.1.1)
hcache backends: kyotocabinet, gdbm, lmdb

Compiler:
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto
Thread model: posix
gcc version 8.2.1 20181127 (GCC) 

Configure options: --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --gpgme --enable-lua --notmuch --gss --ssl --sasl --with-ui=ncurses --with-idn2=/usr --idn=0 --idn2=1 --lmdb --kyotocabinet --gdbm

Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include  -DNCURSES_WIDECHAR

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug 
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color 
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop 
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar 
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash 

Compile options:
  +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens +getaddrinfo 
  -gnutls +gpgme +gss +hcache -homespool +idn -locales_hack +lua +meta 
  -mixmaster +nls +notmuch +openssl +pgp +sasl +smime +start_color 
  +sun_attachment +typeahead 
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <[email protected]>

Extra Info

This only happens in tmux with $TERM being tmux-256color. Set $TERM to be screen-256color or run neomutt directly in a terminal fix this.

  • Operating System and its version
Linux HIDDEN 4.20.13-arch1-1-ARCH #1 SMP PREEMPT Wed Feb 27 19:10:28 UTC 2019 x86_64 GNU/Linux
  • Were you using multiple copies of NeoMutt at once? no
  • Were you using 'screen' or 'tmux'? tmux 2.8
  • Is your email local (maildir) or remote (IMAP)? local(maildir)

Currently my workaround is to run TERM=screen-256color neomutt.

hiecaq avatar Mar 04 '19 23:03 hiecaq

I found myself in same situation today. If i use TERM xterm-265color, alacritty or the one above, neomutt doesn't redraw the screen correctly, it only put new characters on top on old one, which make it unreadable

voanhduy1512 avatar Mar 27 '19 16:03 voanhduy1512

Happens something similar to me, but only with repainting and only on FreeBSD. All working fine on Linux. I tried alacritty, kitty with and without tmux.

Does not seem to repaint any of the windows correctly unless moving the cursor over the items (eg. in index).

ghost avatar Jun 05 '22 16:06 ghost

I'm running NeoMutt in tmux in alacritty without issues. This is the relevant part of my config:

~/.tmux.conf:

set -g default-terminal tmux-256color
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'

bind 7 new -A -s mail "stty discard undef && /Users/dennis/projects/neomutt/neomutt"

Note the stty discard undef when starting NeoMutt.

I'm closing this, as working around all the different quirks in tmux and terminal emulators is not something we can support in NeoMutt.

roccoblues avatar Dec 20 '23 09:12 roccoblues

I'm closing this, as working around all the different quirks in tmux and terminal emulators is not something we can support in NeoMutt.

I am having the same redraw problems on FreeBSD with any terminal emulator I tried (st, urxvt, xterm, Kitty) without any intermediate tmux/screen. No other terminal application on my system has comparable problems. So I wouldn't discount this simply as a misconfigured emulator.

rhaberkorn avatar Feb 10 '24 15:02 rhaberkorn