From nobody Fri Aug 09 20:10:38 2024 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WgZly3gcHz5SpJQ for ; Fri, 09 Aug 2024 20:10:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WgZly10kVz4ThG for ; Fri, 9 Aug 2024 20:10:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723234238; a=rsa-sha256; cv=none; b=mVUC9Rkq0+dSf43JRJ0RfTDmZCbXWV7EBd2rLHqPl0hCgVRrH0MTUFI0q18e81606mFXzS 33KUOAvUUKfhuhrxJTf0y6rTx6W2rvC3YJ2OltyC2jU/7QaUpuRBm2dJvwHY8TujPigSZi XnPKKMiWs6VMOMitFqDhd4Z5Tpv8n/Kc7GYZDtuQnpzObCtB+BmeeZtHnQsb5XPBEKg5MG 8alo7nCT7NZx3NfrqNEkfCktO3P+H41znqZalb6ghNo/mxDjKh8CPrHHizr1KbeAckOLwV SuRzojZnSpaVZnN3hs+qU7QWVF6V0Uc8kn6TspW7G74aQzfKCgMM6Bw3G7pmmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723234238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qm5IU46WPydHdPMHwDi2AS8W8GQFJNRDC2Y0UDDNdAg=; b=Lpp9/wJnojDgKkIDXlndOC9G4VrPpq5X4bDXSASAP1k+Rhi807S7iPPai6ctM7b6mo+HI5 oKUMgnF43l2O/3wDdPwYsVvYWQ6Y0f0Vmvw5jYTmlfXdmY3NLyRxJ40Vc1j9Tj1ObylkYm gpBxUyttq0622jg7+Bkt2eEyUNFPxDp8ou4H5ibi10OyUXen+K/M70Zm0uEc9j/3q5jgXn 9Kqafb8A0hTk7C0LALaw7igheNAyfK6bSsZb9XwZ6UPyBiYc5E3kOq4t3hLyaQWTLPY7F5 zT9mAEo4JHhbqDLzHhbxOCNeVNAW89egzKWSyItQ2QTTsVqpa0dYU5Ym9ZVL3Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WgZly0ZC6zW0J for ; Fri, 9 Aug 2024 20:10:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 479KAbVx074688 for ; Fri, 9 Aug 2024 20:10:37 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 479KAbFL074686 for bugs@FreeBSD.org; Fri, 9 Aug 2024 20:10:37 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 280679] [termcap] [patch] bold colors broken in ncurses apps for xterm-256color Date: Fri, 09 Aug 2024 20:10:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: cullum@sacredheartsc.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280679 --- Comment #4 from Cullum Smith --- While I lack the inclination to grok all the arcane details of termcap/terminfo, after comparing the `infocmp` output for xterm-256color w= ith a Linux system, I believe I understand the problem. Termcap appears to be an older/less expressive format compared to terminfo. FreeBSD's terminfo seems to have a termcap compatibility layer, and reads a= ll the termcap definitions from /etc/termcap. xterm appears to have a quirk that requires some special handling in 256-co= lor mode. On my Linux system, the setaf/setab values for xterm-256color look li= ke this: setab=3D\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, setaf=3D\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, I do not fully understand this line noise, but it appears to have some spec= ial logic for values in between 8 and 16 (the bright colors?) You can't blindly copy this into the xterm-256color definition in /etc/term= cap, because the termcap format seems to lack support for whatever syntax this i= s. However, you can compile a terminfo override and it appears to take precede= nce over /etc/termcap. Running the shell fragment below allows bright colors to work in xterm-256color while maintaining full 256 color capability. # The following was blindly copied from a 'infocmp xterm-256color' on a lin= ux host. cat <<'EOF' > /root/xterm-256color.terminfo xterm-256color|xterm with 256 colors, am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, colors#0x100, cols#80, it#8, lines#24, pairs#0x10000, acsc=3D``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, bel=3D^G, blink=3D\E[5m, bold=3D\E[1m, cbt=3D\E[Z, civis=3D\E[?25l, clear=3D\E[H\E[2J, cnorm=3D\E[?12l\E[?25h, cr=3D\r, csr=3D\E[%i%p1%d;%p2%dr, cub=3D\E[%p1%dD, cub1=3D^H, cud=3D\E[%p1%dB, cud1=3D\n, cuf=3D\E[%p1%dC, cuf1=3D\E[C, cup=3D\E[%i%p1%d;%p2%dH, cuu=3D\E[%p1%dA, cuu1=3D\E[A, cvvis=3D\E[?12;25h, dch=3D\E[%p1%dP, dch1=3D\E[P, dim=3D\E[2m, dl=3D\E[%p1%dM, dl1=3D\E[M, ech=3D\E[%p1%dX, ed=3D\E[J, el=3D\E[K, el1=3D\E[1K, flash=3D\E[?5h$<100/>\E[?5l, home=3D\E[H, hpa=3D\E[%i%p1%dG, ht=3D^I, hts=3D\EH, ich=3D\E[%p1%d@, il=3D\E[%p1%dL, il1=3D\E[L, ind=3D\n, indn=3D\E[%p1%dS, =20=20=20=20=20=20=20 initc=3D\E]4;%p1%d;rgb:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/= %p4%{255}%*%{1000}%/%2.2X\E\\, invis=3D\E[8m, is2=3D\E[!p\E[?3;4l\E[4l\E>, kDC=3D\E[3;2~, kEND=3D\E[1;2F, kHOM=3D\E[1;2H, kIC=3D\E[2;2~, kLFT=3D\E[1;2D, kNXT=3D\E[6;2~, kPRV=3D\E[5;2~, kRIT=3D\E[1;2C, ka1=3D\EOw, ka3=3D\EOy, kb2=3D\EOu, kbs=3D^?, kc1=3D\EOq, kc3=3D\EOs, kcbt=3D\E= [Z, kcub1=3D\EOD, kcud1=3D\EOB, kcuf1=3D\EOC, kcuu1=3D\EOA, kdch1=3D\E[3~, kend=3D\EOF, kent=3D\EOM, kf1=3D\EOP, kf10=3D\E[21~, kf11=3D\E[23~, kf12=3D\E[24~, kf13=3D\E[1;2P, kf14=3D\E[1;2Q, kf15=3D\E[1;2R, kf16=3D\E[1;2S, kf17=3D\E[15;2~, kf18=3D\E[17;2~, kf19=3D\E[18;2~, kf2=3D\EOQ, kf20=3D\E[19;2~, kf21=3D\E[20;2~, kf22=3D\E[21;2~, kf23=3D\E[23;2~, kf24=3D\E[24;2~, kf25=3D\E[1;5P, kf26=3D\E[1;5Q, kf27=3D\E[1;5R, kf28=3D\E[1;5S, kf29=3D\E[15;5~, kf3=3D\EOR, kf30=3D\E[17;5~, kf31=3D\E[18;5~, kf32=3D\E[19;5~, kf33=3D\E[20;5~, kf34=3D\E[21;5~, kf35=3D\E[23;5~, kf36=3D\E[24;5~, kf37=3D\E[1;6P, kf38=3D\E[1;6Q, kf39=3D\E[1;6R, kf4=3D\EOS, kf40=3D\E[1;6S, kf41=3D\E[15;6~, kf42=3D\E[17;6~, kf43=3D\E[18;6~, kf44=3D\E[19;6~, kf45=3D\E[20;6~, kf46=3D\E[21;6~, kf47=3D\E[23;6~, kf48=3D\E[24;6~, kf49=3D\E[1;3P, kf5=3D\E[15~, kf50=3D\E[1;3Q, kf51=3D\E[1;3R, kf52=3D\E[1;3S, kf53=3D\E[15;3~, kf54=3D\E[17;3~, kf55=3D\E[18;3~, kf56=3D\E[19;3~, kf57=3D\E[20;3~, kf58=3D\E[21;3~, kf59=3D\E[23;3~, kf6=3D\E[17~, kf60=3D\E[24;3~, kf61=3D\E[1;4P, kf62=3D\E[1;4Q, kf63=3D\E[1;4R, kf7=3D\E[18~, kf8=3D\E[19~, kf9=3D\E[20~, khome=3D\EOH, kich1=3D\E[2~, kind=3D\E[1;2B, kmous=3D\E[<, knp=3D\E[6~, kpp=3D\E[5~, kri=3D\E[1;2A, mc0=3D\E[i, mc4=3D\E[4i, mc5=3D\E[5i, meml=3D\El, memu=3D\Em, mgc=3D\E[?69l, nel=3D\EE, oc=3D\E]104\007, op=3D\E[39;49m, rc=3D\E8, rep=3D%p1%c\E[%p2%{1}%-%db, rev=3D\E[7m, ri=3D\EM, rin=3D\E[%p1%dT, ritm=3D\E[23m, rmacs=3D\E(B, rmam=3D\E[?7l, rmcup=3D\E[?1049l\E[23;0;0t, rmir=3D\E[4l, rmkx=3D\E[?1l\E>, rmm=3D\E[?1034l, rmso=3D\E[27m, rmul=3D\E[24m, rs1=3D\Ec\E]104\007, rs2=3D\E[!p\E[?3;4l\E[4l\E>, sc=3D\E7, setab=3D\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1= %d%;m, setaf=3D\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%= d%;m, =20=20=20=20=20=20=20 sgr=3D%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;= 7%;%?%p4%t;5%;%?%p7%t;8%;m, sgr0=3D\E(B\E[m, sitm=3D\E[3m, smacs=3D\E(0, smam=3D\E[?7h, smcup=3D\E[?1049h\E[22;0;0t, smglr=3D\E[?69h\E[%i%p1%d;%p2%ds, smir=3D\E[4h, smkx=3D\E[?1h\E=3D, smm=3D\E[?1034h, smso=3D\E[7m, smul=3D\E[4m, tbc=3D\E[3g, u6=3D\E[%i%d;%dR, u7=3D\E[6n, u8=3D\E[?%[;0123456789]c, u9=3D\E[c, vpa=3D\E[%i%p1%dd, EOF tic -o /usr/local/share/site-terminfo /root/xterm-256color.terminfo --=20 You are receiving this mail because: You are the assignee for the bug.=