Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 648720 - app-misc/tmux-2.6 with sys-libs/ncurses-6.1-r1: open terminal failed: missing or unsuitable terminal: screen-256color
Summary: app-misc/tmux-2.6 with sys-libs/ncurses-6.1-r1: open terminal failed: missing...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 3 votes (vote)
Assignee: Gentoo Shell Tools Herd Bugs
: 651644 (view as bug list)
Depends on:
Blocks: 648114 ncurses-6.1
  Show dependency tree
Reported: 2018-02-24 18:18 UTC by Dennis Schridde
Modified: 2022-06-17 01:53 UTC (History)
17 users (show)

See Also:
Package list:
Runtime testing required: ---

ncurses-compat-6.1_p20190609.ebuild (ncurses-compat-6.1_p20190609.ebuild,6.25 KB, text/plain)
2019-10-16 16:22 UTC, Joakim Tjernlund

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2018-02-24 18:18:51 UTC
I have set in ~/.tmux.conf:
set-option -s default-terminal "screen-256color"

Since I upgraded to sys-libs/ncurses-6.1-r1, I get the following error everytime I try to start tmux:
open terminal failed: missing or unsuitable terminal: screen-256color

Portage 2.3.24 (python 2.7.13-final-42, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-7.3.0, glibc-2.26-r6, 4.15.4-gentoo x86_64)
                         System Settings
System uname: Linux-4.15.4-gentoo-x86_64-AMD_Ryzen_5_2400G_with_Radeon_Vega_Graphics-with-gentoo-2.4.1
KiB Mem:    31777556 total,   3369448 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 24 Feb 2018 11:15:01 +0000
Head commit of repository gentoo: 3df07552decade334030ee8b793e40a34a9a2688
Head commit of repository flatpak-overlay: 8e157d3d671b3d9b1a265e99b581d8d746f70816

Head commit of repository riscv: e85f7c6f1952d8aede836bb5ec60b44032818dfb

Timestamp of repository sage-on-gentoo: Mon, 19 Feb 2018 04:45:41 +0000
Head commit of repository sage-on-gentoo: a15bd71d373855189d4139225b995cf3985b9d77

Timestamp of repository science: Fri, 09 Feb 2018 23:25:47 +0000
Head commit of repository science: 7d62e55fab1c22bd3722d6343d95a49ffe97d2ec

Timestamp of repository steam-overlay: Sun, 11 Feb 2018 18:15:19 +0000
Head commit of repository steam-overlay: 62b535d189274ce98f9cac980428de36cc51a704

sh bash 4.4_p19
ld GNU ld (Gentoo 2.30 p1) 2.30.0
ccache version 3.3.4 [disabled]
app-shells/bash:          4.4_p19::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r2::gentoo
dev-lang/python:          2.7.14-r101::sage-on-gentoo, 3.5.4-r1::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.10.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.30::gentoo
sys-devel/gcc:            7.3.0::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r2::gentoo
sys-kernel/linux-headers: 4.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r6::gentoo

    location: /var/cache/portage/gentoo
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-verify-metamanifest: yes

    location: /var/db/repos/flatpak-overlay
    sync-type: git
    sync-uri: git://
    masters: gentoo

    location: /var/db/repos/riscv
    sync-type: git
    masters: gentoo

    location: /var/db/repos/sage-on-gentoo
    sync-type: git
    masters: gentoo science

    location: /var/db/repos/science
    sync-type: git
    masters: gentoo

    location: /var/db/repos/steam-overlay
    sync-type: git
    masters: gentoo

    location: /var/cache/portage/local
    masters: gentoo riscv
    priority: 100

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-pipe -O2 -march=znver1"
CONFIG_PROTECT="/etc /etc/grs/systems.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-pipe -O2 -march=znver1"
EMERGE_DEFAULT_OPTS="--keep-going --nospinner --verbose-conflicts"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg cgroup compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="de en en_GB ar fa tr"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X a52 aac aacplus aacs acl acpi activities alsa amd64 appindicator appstream archive audit avahi ayatana bash-completion bdplus berkdb bluetooth bluray branding brotli bs2b bzip2 cairo caps cdda cddb cdio cdr celt chromaprint cjk clang cli colord colorio conntrack crypt cups cxx d3d9 dbus declarative dirac djvu dri dts dvb dvd dvdr egl emboss encode epub exif fam fax fbcon ffmpeg fftw fish-completion fits flac fontconfig fortran fribidi ftdi gdbm geoclue geolocation gif git glamor gles gmp google googledrive gpg gpm gps graphicsmagick gstreamer gtk gtk3 harfbuzz hdf5 ibus iconv icu idn imlib inotify introspection ipv6 jemalloc jpeg jpeg2k kde kipi kwallet ladspa latex lcms ldap libidn2 libinput libnotify libproxy libsecret libsoxr lv2 lz4 lzma lzo mad markdown mercurial metis mjpeg mng mobi modemmanager modplug modules mp3 mp4 mpeg mplayer mtp multilib mysql ncurses netlink networkmanager nftables nls nptl office ofono ogg openal opencl openconnect opencv openexr opengl openh264 openmax openmp openvpn opus pam pango pcap pch pcre pcre2 pdf phonon plasma png policykit postscript ppds prison pulseaudio python qml qt3support qt5 raw readline rtmp samba scanner schroedinger sctp sdl seccomp semantic-desktop share snappy sparse speech speex spell ssl startup-notification svg systemd tbb tcpd teamd telepathy tga theora threads tiff timezone truetype tslib udev udisks unicode unwind upnp upnp-av upower usb utempter v4l v4l2 vaapi vdpau vorbis vpnc vpx vulkan wavpack wayland webp widgets x264 x265 xattr xcb xcomposite xft xinerama xkb xml xmp xrandr xscreensaver xv xvid xwayland xz zeroconf zeromq zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_EXPERIMENTAL_FEATURES="stage" CALLIGRA_FEATURES="words sheets karbon plan" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" ENLIGHTENMENT_MODULES="*" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="joystick libinput" KERNEL="linux" L10N="de en en-GB ar fa tr ja ko zh zh-CN zh-TW" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="devinput" LUA_TARGET="lua5-2" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5 pypy pypy3" RUBY_TARGETS="ruby22 ruby23" STEAMGAMES="dirt_rally dont_starve portal source_engine te120 trine2 witcher2" USERLAND="GNU" VIDEO_CARDS="amdgpu virgl" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

                        Package Settings

app-misc/tmux-2.6::gentoo was built with the following:
USE="-debug (-selinux) -utempter -vim-syntax" ABI_X86="(64)"

sys-libs/ncurses-5.9-r101::gentoo was built with the following:
USE="gpm tinfo unicode" ABI_X86="32 (64) (-x32)"

sys-libs/ncurses-6.1-r1::gentoo was built with the following:
USE="cxx gpm threads tinfo unicode -ada -debug -doc -minimal -profile -static-libs -test -trace" ABI_X86="32 (64) (-x32)"
Comment 1 Mark Nowiasz 2018-02-28 15:19:06 UTC
Same here, in my case it's xterm-256color which won't work via ssh:

open terminal failed: missing or unsuitable terminal: xterm-256color
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-03-28 08:40:50 UTC
There may be two workarounds:

In case your affected user still has running tmux sessions, you need to use a different TERM setting:

  TERM="xterm-color" tmux

If you want to get rid of this "workaround", close all tunning tmux sessions and you should be able to start tmux with *-256color TERM setting again.
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-03-28 10:24:34 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #2)
> There may be two workarounds:
> In case your affected user still has running tmux sessions, you need to use
> a different TERM setting:
>   TERM="xterm-color" tmux
> If you want to get rid of this "workaround", close all tunning tmux sessions
> and you should be able to start tmux with *-256color TERM setting again.

Comment 4 vylaern 2018-04-09 15:39:15 UTC
I had similar problem with games-roguelike/dwarf-fortress. When I was trying to start TEXT mode, I had such error:
Error opening terminal: xterm-256color

Downgrading ncurses from 6.1-r2 into 6.0-r1 temporary solved my problems.
Comment 5 Pacho Ramos gentoo-dev 2018-04-14 11:22:01 UTC
is tmux-2.7 also affected by this?
Comment 6 wippie 2018-04-20 19:48:34 UTC
Just wanted to leave a reminder of [ GLSA 201804-13 ] ncurses
Comment 7 SpanKY gentoo-dev 2018-06-25 21:39:11 UTC
/usr/share/terminfo/s/screen-256color should be a symlink to ../../../../etc/terminfo/s/screen-256color, and obviously you should have the real file at /etc/terminfo/s/screen-256color.  please check those paths exist.

if they don't, please attach the full build log of ncurses.
Comment 8 SpanKY gentoo-dev 2018-06-25 21:57:09 UTC
*** Bug 651644 has been marked as a duplicate of this bug. ***
Comment 9 SpanKY gentoo-dev 2018-06-25 22:43:07 UTC
although to re-iterate Lars' point from comment #3, are you connecting to an existing session or does this show up when creating a new one ?

if it's an existing session, i think we're just going to say you need to restart all your sessions.  or `reboot` if you're lazy :p.
Comment 10 Simon 2018-06-26 20:39:36 UTC
I'm coming from the gradle issue (, I have /etc/terminfo/s/screen-256color and /usr/share/terminfo/s/screen-256color is a symlink to it.

So far only exporting TERM=xterm-color seems to work as a workaround.
Default value I have for it is xterm-256color
Comment 11 HelLViS69 2018-08-07 19:41:52 UTC
Same as @simon here
Comment 12 David 2018-08-11 00:05:43 UTC
I had a similar issue with xterm-256color and gradle, I was able to resolve this with sys-libs/ncurses-6.1-r2 enabling tinfo USE flag and making sure to remove any old preserved libs (for me this was &

Tested with gradle-bin-3.1 and gradle-3.4.1
Comment 13 Robert G. Siebeck 2018-08-11 21:47:51 UTC
(In reply to David from comment #12)
> I had a similar issue with xterm-256color and gradle, I was able to resolve
> this with sys-libs/ncurses-6.1-r2 enabling tinfo USE flag and making sure to
> remove any old preserved libs (for me this was &
> Tested with gradle-bin-3.1 and gradle-3.4.1

That fixed it for me as well, thank you for the hint.

Tested with gradle-bin-4.7 from an overlay.
Comment 14 Anton Bolshakov 2019-07-04 00:05:48 UTC
The upstream has re-open the issue but there is further progress at the moment.
Comment 15 Joakim Tjernlund 2019-10-16 16:20:49 UTC
I think this problem is an internal ncurses ABI problem. ncursers 5.9
cannot understand the newer xterm-256color terminfo.

I took ncurses-6.1_p20190609.ebuild and converted it to 
ncurses-compat-6.1_p20190609.ebuild by copiimg the configure logic in 5.9 plus
added  --with-abi-version=5.9 and built that.
Got new *.so.5 libs and now apps using *.so.5 libs understands xterm-256color

If this new ncurses-compat pkg is 100 % ABI compatible against the
older ncurses-compat-5.9 remains to be seen ...
Comment 16 Joakim Tjernlund 2019-10-16 16:22:35 UTC
Created attachment 592886 [details]

This is my converted package
Comment 17 Joakim Tjernlund 2019-12-03 12:16:02 UTC
(In reply to Joakim Tjernlund from comment #16)
> Created attachment 592886 [details]
> ncurses-compat-6.1_p20190609.ebuild
> This is my converted package

ncurses-compat-6.1_p20190609 is now in the tree
Comment 18 Maxim P. Dementiev 2020-04-12 23:24:14 UTC
Thanks a lot for ncurses-compat-6.1_p20190609!
It really helped me with binary Gradle 6.4-20200409155744+0000