Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "WARNING: terminal is not fully functional" when using tmux-256color on macOS Catalina #2262

Closed
imomaliev opened this issue Jun 6, 2020 · 37 comments

Comments

@imomaliev
Copy link

imomaliev commented Jun 6, 2020

Issue description

I am getting "WARNING: terminal is not fully functional" when I try to set. I could fix this by setting default-terminal to xterm-256color or by setting export TERM=xterm-256color but I am not sure this is the correct way to fix this. I pretty sure I am missing something.

echo 'set -g default-terminal "tmux-256color"' > test.conf
tmux -f test.conf

Required information

Darwin i386
tmux 3.1b
xterm-256color
MacOS Catalina 10.15.5
tmux installed via homebrew
Using default Terminal.app

tmux-client-16221.log
tmux-out-16223.log
tmux-server-16223.log

@nicm
Copy link
Member

nicm commented Jun 6, 2020

OS X has a very old ncurses with no tmux-256color you will need to either use screen-256color inside tmux or install it yourself. You can get it here https://gist.github.com/nicm/ea9cf3c93f22e0246ec858122d9abea1 and install with tic -x (make sure you use the system tic from /use/bin).

@rohchakr
Copy link

rohchakr commented Jun 6, 2020

I also have a very similar issue
I am using gnome-terminal with 256-colors and italicized texts without any issues.

With tmux, everything is fine with $TERM set to screen-256color except italicized texts.

Setting $TERM to tmux-256color resolves the italicized text issue, but results in this new issue related to 'terminal capabilities'

My ncurses version doesn't support 'tmux-256color'

When I try installing tmux-256color using the above instructions by @nicm, getting the below errors (attached log file)
tic_errors.log

@nicm
Copy link
Member

nicm commented Jun 6, 2020 via email

@rohchakr
Copy link

rohchakr commented Jun 6, 2020

Oops, Thanks a lot!

I could run tic -x tmux-256color successfully,
closed all tmux sessions

Even after that for new tmux session also, I am getting the same old issues

Issue 1 : Warning terminal is not fully functional
for git commands - git logs
Issue 2 : E437: terminal capability "cm" required
when trying to open vim

Well, outside tmux all the git functionalities and vim works just fine.

@nicm
Copy link
Member

nicm commented Jun 6, 2020

What does echo $TERM show?

@rohchakr
Copy link

rohchakr commented Jun 6, 2020

tmux-256color

@nicm
Copy link
Member

nicm commented Jun 6, 2020

What does infocmp -x tmux-256color show?

@rohchakr
Copy link

rohchakr commented Jun 6, 2020

What does infocmp -x tmux-256color show?

infocmp.log

@nicm
Copy link
Member

nicm commented Jun 6, 2020

This is an unusual place for terminfo to be stored, are you sure you ran the tic corresponding to the ncurses library your programs are using?

@rohchakr
Copy link

rohchakr commented Jun 6, 2020

Sorry, it is working now,
i had missed another instruction
after running the, everything is fine
/usr/bin/tic -x tmux-256color

I had another tic installed by conda package

Thanks a lot!

I was stuck for a long time getting my desired setup at place.

@imomaliev
Copy link
Author

imomaliev commented Jun 7, 2020

OS X has a very old ncurses with no tmux-256color you will need to either use screen-256color inside tmux or install it yourself. You can get it here https://gist.github.com/nicm/ea9cf3c93f22e0246ec858122d9abea1 and install with tic -x (make sure you use the system tic from /use/bin).

Tmux is installed via homebrew and comes newer version of ncurses

~/development/dotfiles % brew info ncurses
ncurses: stable 6.2 (bottled) [keg-only]
Text-based UI library
https://www.gnu.org/software/ncurses/
/usr/local/Cellar/ncurses/6.2 (3,913 files, 8.6MB)
  Poured from bottle on 2020-06-05 at 20:59:29
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ncurses.rb
==> Dependencies
Build: pkg-config ✔
==> Caveats
ncurses is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ncurses first in your PATH run:
  echo 'export PATH="/usr/local/opt/ncurses/bin:$PATH"' >> ~/.zshrc

For compilers to find ncurses you may need to set:
  export LDFLAGS="-L/usr/local/opt/ncurses/lib"
  export CPPFLAGS="-I/usr/local/opt/ncurses/include"

For pkg-config to find ncurses you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ncurses/lib/pkgconfig"

==> Analytics
install: 88,330 (30 days), 314,491 (90 days), 1,139,737 (365 days)
install-on-request: 2,162 (30 days), 8,467 (90 days), 29,202 (365 days)
build-error: 0 (30 days)

I have add it to the path it it didn't help

~/development/dotfiles % infocmp tmux-256color
#	Reconstructed via infocmp from file: /usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color
tmux-256color|tmux with 256 colors,
	am, hs, km, mir, msgr, xenl,
	colors#0x100, cols#80, it#8, lines#24, pairs#0x10000,
	acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
	clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=\r,
	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
	cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
	dl=\E[%p1%dM, dl1=\E[M, dsl=\E]0;\007, ed=\E[J, el=\E[K,
	el1=\E[1K, enacs=\E(B\E)0, flash=\Eg, fsl=^G, home=\E[H,
	hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
	il=\E[%p1%dL, il1=\E[L, ind=\n, indn=\E[%p1%dS,
	invis=\E[8m, is2=\E)0, kDC=\E[3;2~, kEND=\E[1;2F,
	kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~,
	kPRV=\E[5;2~, kRIT=\E[1;2C, kbs=^H, kcbt=\E[Z, kcub1=\EOD,
	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~,
	kend=\E[4~, kf1=\EOP, kf10=\E[21~, kf11=\E[23~,
	kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R,
	kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~,
	kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~,
	kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
	kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
	kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~,
	kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~,
	kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q,
	kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~,
	kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~,
	kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
	kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q,
	kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
	kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~,
	kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~,
	kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
	kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
	kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
	kri=\E[1;2A, nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m,
	ri=\EM, ritm=\E[23m, rmacs=^O, rmcup=\E[?1049l, rmir=\E[4l,
	rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
	rs2=\Ec\E[?1000l\E[?25h, sc=\E7,
	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
	sgr0=\E[m\017, sitm=\E[3m, smacs=^N, smcup=\E[?1049h,
	smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
	tbc=\E[3g, tsl=\E]0;, vpa=\E[%i%p1%dd,
~/development/dotfiles % infocmp -x tmux-256color
#	Reconstructed via infocmp from file: /usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color
tmux-256color|tmux with 256 colors,
	OTbs, OTpt, am, hs, km, mir, msgr, xenl, AX, G0,
	colors#0x100, cols#80, it#8, lines#24, pairs#0x10000, U8#1,
	acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
	bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
	clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=\r,
	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
	cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
	dl=\E[%p1%dM, dl1=\E[M, dsl=\E]0;\007, ed=\E[J, el=\E[K,
	el1=\E[1K, enacs=\E(B\E)0, flash=\Eg, fsl=^G, home=\E[H,
	hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
	il=\E[%p1%dL, il1=\E[L, ind=\n, indn=\E[%p1%dS,
	invis=\E[8m, is2=\E)0, kDC=\E[3;2~, kEND=\E[1;2F,
	kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~,
	kPRV=\E[5;2~, kRIT=\E[1;2C, kbs=^H, kcbt=\E[Z, kcub1=\EOD,
	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~,
	kend=\E[4~, kf1=\EOP, kf10=\E[21~, kf11=\E[23~,
	kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R,
	kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~,
	kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~,
	kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
	kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
	kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~,
	kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~,
	kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q,
	kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~,
	kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~,
	kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
	kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q,
	kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
	kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~,
	kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~,
	kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
	kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
	kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
	kri=\E[1;2A, nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m,
	ri=\EM, ritm=\E[23m, rmacs=^O, rmcup=\E[?1049l, rmir=\E[4l,
	rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
	rs2=\Ec\E[?1000l\E[?25h, sc=\E7,
	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
	sgr0=\E[m\017, sitm=\E[3m, smacs=^N, smcup=\E[?1049h,
	smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
	tbc=\E[3g, tsl=\E]0;, vpa=\E[%i%p1%dd, Cr=\E]112\007,
	Cs=\E]12;%p1%s\007, E0=\E(B, E3=\E[3J,
	Ms=\E]52;%p1%s;%p2%s\007, S0=\E(%p1%c, Se=\E[2 q,
	Smulx=\E[4\:%p1%dm, Ss=\E[%p1%d q, TS=\E]0;,
	kDC3=\E[3;3~, kDC4=\E[3;4~, kDC5=\E[3;5~, kDC6=\E[3;6~,
	kDC7=\E[3;7~, kDN=\E[1;2B, kDN3=\E[1;3B, kDN4=\E[1;4B,
	kDN5=\E[1;5B, kDN6=\E[1;6B, kDN7=\E[1;7B, kEND3=\E[1;3F,
	kEND4=\E[1;4F, kEND5=\E[1;5F, kEND6=\E[1;6F,
	kEND7=\E[1;7F, kHOM3=\E[1;3H, kHOM4=\E[1;4H,
	kHOM5=\E[1;5H, kHOM6=\E[1;6H, kHOM7=\E[1;7H,
	kIC3=\E[2;3~, kIC4=\E[2;4~, kIC5=\E[2;5~, kIC6=\E[2;6~,
	kIC7=\E[2;7~, kLFT3=\E[1;3D, kLFT4=\E[1;4D,
	kLFT5=\E[1;5D, kLFT6=\E[1;6D, kLFT7=\E[1;7D,
	kNXT3=\E[6;3~, kNXT4=\E[6;4~, kNXT5=\E[6;5~,
	kNXT6=\E[6;6~, kNXT7=\E[6;7~, kPRV3=\E[5;3~,
	kPRV4=\E[5;4~, kPRV5=\E[5;5~, kPRV6=\E[5;6~,
	kPRV7=\E[5;7~, kRIT3=\E[1;3C, kRIT4=\E[1;4C,
	kRIT5=\E[1;5C, kRIT6=\E[1;6C, kRIT7=\E[1;7C, kUP=\E[1;2A,
	kUP3=\E[1;3A, kUP4=\E[1;4A, kUP5=\E[1;5A, kUP6=\E[1;6A,
	kUP7=\E[1;7A, rmxx=\E[29m, smxx=\E[9m,

@nicm
Copy link
Member

nicm commented Jun 7, 2020

Right tmux uses the Homebrew ncurses, but you can't rebuild all the system applications, they are still using the old system ncurses.

#	Reconstructed via infocmp from file: /usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color

This is not where the system ncurses looks for terminfo, like I said, you have to install it using /usr/bin/tic.

@imomaliev
Copy link
Author

imomaliev commented Jun 7, 2020

So if I understand correctly, I need to run

/usr/bin/tic -x /usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color

?

Got

~/development/dotfiles % /usr/bin/tic -x /usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color
"/usr/local/Cellar/ncurses/6.2/share/terminfo/74/tmux-256color", line 1, col 1: Illegal character (expected alphanumeric or @%&*!#) - '^^'

@nicm
Copy link
Member

nicm commented Jun 7, 2020 via email

@imomaliev
Copy link
Author

imomaliev commented Jun 7, 2020

Thank you very much! This helped. Now I need to wrap this in more canonical way for personal setup. Is it ok to delete xyz after that?

@nicm
Copy link
Member

nicm commented Jun 7, 2020

Yes you can delete it.

@imomaliev
Copy link
Author

Great. Thanks again.

@imomaliev
Copy link
Author

For future reference there was a typo in your answer

infocmp -x tmux-256color >xyz
/usr/bin/tic -x xyz
#  ^ here was "use"

@carlocab
Copy link

Just as a heads-up to anyone who comes across this, the tmux-256color terminfo that comes with the latest Homebrew ncurses, or the one downloaded from invisible-island.net (as suggested here) don't work with htop.

The one in the gist linked above does, however.

Details at htop-dev/htop#251.

@ThomasDickey
Copy link

The most likely explanation is that you're not actually using ncurses 6.2, but getting the (very old) ncurses 5.7. There's no analysis given on the htop issues page, so that's not helpful.

@carlocab
Copy link

@ThomasDickey Probably, yes. Homebrew doesn't want to override the built-in (old) ncurses for fear of breaking something. I could try to see if getting my system to use the newer ncurses solves my original issue too, if you're interested.

@krader1961
Copy link

FWIW, Running otool -L /usr/local/bin/htop on my macOS system where htop has been installed via HomeBrew reports

/usr/local/bin/htop:
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
        /usr/local/opt/ncurses/lib/libncursesw.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

And htop works fine for me inside tmux.

@carlocab
Copy link

Same:

❯ otool -L /usr/local/bin/htop
/usr/local/bin/htop:
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0)
        /usr/local/opt/ncurses/lib/libncursesw.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)

@ThomasDickey
Copy link

There are at least two pitfalls for macOS:

  • if one happened to use the system (ncurses 5.7) tic to compile the terminfo database, it will produce a corrupt database (see discussion in the 6.2 announcement).
  • Assuming that issue wasn't noticeable, it will store the 65536 value for pairs as 0 (making colors not work).

However, compiling the database with ncurses 6.2, an ncurses 5.7 application wouldn't be able to open that database entry (see discussion in ncurses 6.1 announcement).

@carlocab
Copy link

Thanks for the explanation. The first point applies in my case.

Using system tic is expressly @nicm's advice, which you can see up this thread.

@ThomasDickey
Copy link

ThomasDickey commented Oct 30, 2020

I'd use only the tic from a current port (I use MacPorts for things like that; homebrew is probably adequate).

You might find this informative as well: What platforms does it run on?

@nicm
Copy link
Member

nicm commented Oct 30, 2020

For tmux you need to use the tic from the ncurses that tmux is built against, which will depend on how you built tmux. If you built it from Homebrew/MacPorts/whatever then it will probably use their ncurses.

You need to use the system tic for any builtin macOS programs that use ncurses (are there any?) or any programs you have built against the system ncurses. Because this is very old it will not work with the latest terminfo entries.

@carlocab
Copy link

carlocab commented Oct 31, 2020

Thanks very much for all the info.

I think I somewhat understand what's going on now. To summarise (apologies if this is mostly repetitive of earlier information):

Programs built against Homebrew ncurses didn't need a definition of tmux-256color; one was already provided in the packaged terminfo database. However, this will cause issues with programs that try to use the system ncurses, which doesn't know what tmux-256color is. Trying to rectify that by compiling the appropriate entry in the system terminfo database using system tic is then what caused the lack of colour in htop.

It seems the ideal solution would be for me to be able to specify different terminfo databases depending on the version of ncurses being used. Is that even possible? I tried using sudo /usr/bin/tic -o/usr/share/terminfo to get system tic to store the tmux-256color in the system database, but that didn't work. (It created a database at $HOME/.terminfo instead.)

@nicm:

You need to use the system tic for any builtin macOS programs that use ncurses (are there any?)

Yes, a very rough count (if otool -L + grep is any indication) gives me about 50 of them. Unfortunately, a number of Homebrew packages are also built against system ncurses.

@ThomasDickey
Copy link

ncurses handles multiple terminfo databases:

  • each copy of the library has compiled-in a search-list for the terminfo database (which can be overridden using the TERMINFO and TERMINFO_DIRS environment variables).
  • The system- and homebrew ncurses would have different search-paths.
  • Running the tic program from each (system and homebrew) without setting options or environment variables will try to write to the corresponding terminfo database.
  • For macOS, I'd assume that its system terminfo falls into the system-protection (and ordinarily attempts to write to it even as root will fail).
  • When ncurses's tic can't write to the system terminfo, it falls back to the $HOME/.terminfo (likely what you're seeing).

@carlocab
Copy link

Yes, I had also guessed that SIP is what's stopping me from writing to /usr/share/terminfo.

I had tried exploiting the different ways in which Homebrew and system ncurses parse the TERMINFO_DIRS variable (Homebrew treats empty entries as references to its built-in database, whereas the system one checks /usr/share/terminfo). {/usr/local/bin/,/usr/bin}infocmp -x tmux-256color give me references to the correct databases (Homebrew and custom-compiled by system tic respectively), but I still get errors with programs like less, unfortunately. (WARNING: terminal is not fully functional.)

@ThomasDickey
Copy link

infocmp (again, the one corresponding to the library in use) will show where it reads the terminal description from, as the first line of its output.

The ncurses 5.7 tic sees colors#65536 as colors#0 (which is why colors don't work). The recent (ncurses 6.1 and later) versions handle that. For a single terminal description, changing that to colors#32767 "works", but attempting to compile the whole terminal database runs into bugs outlined in the ncurses 6.2 release announcement.

@duhd1993
Copy link

duhd1993 commented Feb 24, 2021

I kinda understand what happens from previous posts. Somehow only installing new terminfo for system ncurses would be the best. The homebrew ncurses already serves homebrew installed programs. But with SIP, system ncurses also installs to HOME with some terminfo directives not recognized, which breaks things like htop. So what is the best way to go?

  • Use the one provided by Nocholas?
  • Turn off SIP, install, and turn back on?

@ThomasDickey
Copy link

I wouldn't make a practice of compiling anything using Apple's very-old copy of ncurses.

@duhd1993
Copy link

I wouldn't make a practice of compiling anything using Apple's very-old copy of ncurses.

Yes. Thanks for the advice. But we cannot replace the built in tools that already uses system ncurses.

@gpanders
Copy link

gpanders commented Apr 14, 2021

I kinda understand what happens from previous posts. Somehow only installing new terminfo for system ncurses would be the best. The homebrew ncurses already serves homebrew installed programs. But with SIP, system ncurses also installs to HOME with some terminfo directives not recognized, which breaks things like htop. So what is the best way to go?

  • Use the one provided by Nocholas?

  • Turn off SIP, install, and turn back on?

Alas, I don't think the second option is even possible. I just tried it myself, and even if you disable SIP /usr/share/terminfo is still read-only.

So on Catalina I think the only options are to either use screen-256color and live without italics or use the terminfo entry provided by @nicm and hope for the best.

@nicm, can you tell us in what way the tmux-256color terminfo entry you linked here differs from the tmux-256color definition in ncurses 6.2?

UPDATE: I checked the diff and it looks like the main difference is simply that it uses pairs#32768 instead of pairs#65536, presumably to avoid the bug that Thomas mentioned. So it seems like you can simply do this on Catalina or later:

$ infocmp -x tmux-256color | sed -e 's/pairs#0x10000/pairs#0x1000/' -e 's/pairs#65536/pairs#32768/' > tmux-256color.src
$ /usr/bin/tic -x tmux-256color.src

@ThomasDickey
Copy link

agreed - that should work reliably. What won't work is compiling the whole terminal database.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2021
molawson added a commit to molawson/dotfiles that referenced this issue Oct 21, 2021
Using this term lets tmux render fonts with more variations (e.g.
italics). But something about it is broken on macOS when you try to run
certain terminal commands. There's a warning about the terminal not
being fully functional. There's an issue on the tmux repo that outlines
the issue and the fix: tmux/tmux#2262

This downloads the tmux-256color term linked by the tmux contributor on
that issue, checks that the contents haven't changed since a known good
version, and installs it properly.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

8 participants