0

I have my term set to tmux-256color through .tmux.conf, but I can't get 256 color mode in an ncurses app working. According to this post it should be supported by now. xterm-256color works perfectly fine.

Running the app with:

 env TERM=tmux-256color ./ncurses_app

doesn't work either. The same is true for screen-256color.

CMAKE Script:

cmake_minimum_required(VERSION 3.8)
project(pkgsinfo)

set(CMAKE_C_STANDARD 11)

set(CMAKE_VERBOSE_MAKEFILE  on)
set(SOURCE_FILES
   ProjectFiles.c)

set(CURSES_NEED_WIDE ON)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/Modules")
find_package(Curses 6 EXACT REQUIRED)
add_executable(pkgsinfo ${SOURCE_FILES})
target_link_libraries(pkgsinfo ${CURSES_LIBRARIES})

The link arguments for this project:

/usr/bin/cc -g   CMakeFiles/pkgsinfo.dir/ProjectFiles.c.o -o 
pkgsinfo /usr/lib/libncursesw.so /usr/lib/libtinfo.so -lform

It's using the wide library. Also screen-256color and tmux-256color are installed in the terminfo database.

Is full support for tmux and screen 256color still not in?

  • The question doesn't say how/why you see it's not working :-) – Thomas Dickey Oct 24 '17 at 19:57
1

That's rather vague: either the terminal entry is installed, or it's not. Systems (such as Debian and those derived from it such as Ubuntu) which default to a "small" terminal database don't install any of the tmux variants.

If you set TERM to something that is not installed, both screen and tmux will give an error and stop. ncurses applications calling initscr also will give an error, and stop.

When using 256-colors, you would need ncurses6 and use the wide-character library, e.g., -lncursesw since the narrow (-lncurses) library supports only up to 16 colors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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