From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 28 08:01:05 2022 Received: (at submit) by debbugs.gnu.org; 28 Mar 2022 12:01:05 +0000 Received: from localhost ([127.0.0.1]:57424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYo3U-0005X5-UL for submit@debbugs.gnu.org; Mon, 28 Mar 2022 08:01:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:56784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYo3T-0005Wy-KE for submit@debbugs.gnu.org; Mon, 28 Mar 2022 08:01:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:36068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYo3T-0001Tj-41 for bug-guix@gnu.org; Mon, 28 Mar 2022 08:01:03 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:52077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYo3Q-0008WO-Fx for bug-guix@gnu.org; Mon, 28 Mar 2022 08:01:02 -0400 Received: (Authenticated sender: roman@riabenko.com) by mail.gandi.net (Postfix) with ESMTPSA id F01311BF205 for ; Mon, 28 Mar 2022 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riabenko.com; s=gm1; t=1648468854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=WtPj3SpFnuIvxYNou+EEaxOypsHs48t40IvX++tqUdc=; b=ZrMXQ8h2p3BEhYsCQ5lSKRdxN8n8i1K+o17Tpmy90TIuh4IvCtAytDXr91im98fubDMkYf TzA+Xn7NTYLkB4+E68IPALnxzmTvFKIMCIP3hLnbIQP4Qff4WHJOhd7zsSUdMMcGQZpkSS NJNQoFCZ1Ca/v1cIjN2PeSFCSeFZLCBSX+b78L2sn96ZezShqYazrPq1PCkuXWMg+uiKoz 4G1b+/a4s9HadS5kETRjnCAwyk2J6NeZhVDwB2kud1fqgj1Mi4ERZkbuPb+eIS2NXwlGsB 1NuVwEo3Ntsd7h+n2d536XScHKSc0Rt+hSd6tauiEhfxN32+H8HzgQpMOUVDsA== Message-ID: Subject: ncurses attrset colour pair ignored in favour of bkgd From: Roman Riabenko To: bug-guix@gnu.org Date: Mon, 28 Mar 2022 15:00:52 +0300 Content-Type: multipart/mixed; boundary="=-wmmPSiH+BQOY3k/VXN8l" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Received-SPF: pass client-ip=217.70.183.201; envelope-from=roman@riabenko.com; helo=relay8-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) --=-wmmPSiH+BQOY3k/VXN8l Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hello With ncurses, the "attrset" colour pair is ignored when the background colour pair is set with "bkgd". I ran into this issue when compiling robotfindskitten, but it is not specific to that program and can be reproduced with the attached small test code. When compiled with "gcc test.c -lncurses", "./a.out" is expected to display the sample text in yellow (the brownish curses equivalent of yellow), which is set with "attrset". It does so when compiled as usual without guix. If compiled in guix, the sample text is blue instead, which is set with "bkgd" for background and for some reason is not overridden by "attrset". If the "bkgd" line is removed, "attrset" works as usual. This affects software compiled in a guix shell (guix environment), or on a guix system, or with "guix build" and "guix install". It does not seem to be caused by the terminal properties or environment variables because it can be reproduced on the same Debian machine after compiling (1) with guix (in a guix environment) and (2) without guix. I tried compiling with guix having ncurses 6.2.20210619 (current guix) and 6.2.20200212 (from the older guix image from the website and in Debian bullseye). I tried compiling without guix on Debian with development packages for ncurses 6.2+20201114-2 (bullseye) and 6.3-2 (bookworm) and on Fedora with its development package for ncurses 6.2.20210508. I was pointed in a forum to "render_char" function in lib_addch.c, [1] which defines how colour is applied. But there seem to be no modifications to that in guix as far as I can see. [1]: https://github.com/ThomasDickey/ncurses-snapshots/blob/6b3112c16ee04882a512f9aa967e34dba5e362e1/ncurses/base/lib_addch.c#L57 Roman --=-wmmPSiH+BQOY3k/VXN8l Content-Disposition: attachment; filename="test.c" Content-Type: text/x-csrc; name="test.c"; charset="UTF-8" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPG5jdXJzZXMuaD4KCmludCBtYWluKCkgewogICAgICAgCWluaXRzY3IoKTsKCXN0 YXJ0X2NvbG9yKCk7Cglpbml0X3BhaXIgKCAxLCBDT0xPUl9CTFVFLCBDT0xPUl9CTEFDSyApOwoJ aW5pdF9wYWlyICggMiwgQ09MT1JfWUVMTE9XLCBDT0xPUl9CTEFDSyApOwoJYmtnZCAoIChjaHR5 cGUpIENPTE9SX1BBSVIoMSkgKTsKCWF0dHJzZXQgKCBDT0xPUl9QQUlSKDIpICk7CglwcmludHcg KCAiTk8gV0FSISIgKTsKCXJlZnJlc2goKTsKCWdldGNoKCk7CgllbmR3aW4oKTsKCXJldHVybiAw Owp9Cg== --=-wmmPSiH+BQOY3k/VXN8l-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 29 08:29:28 2022 Received: (at 54607) by debbugs.gnu.org; 29 Mar 2022 12:29:28 +0000 Received: from localhost ([127.0.0.1]:60106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZAyV-0008G7-Nz for submit@debbugs.gnu.org; Tue, 29 Mar 2022 08:29:27 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:12752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nZAyT-0008Fp-Ml for 54607@debbugs.gnu.org; Tue, 29 Mar 2022 08:29:26 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KSTQT4tfXz1LZ3H; Tue, 29 Mar 2022 14:29:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4KSTQT4tfXz1LZ3H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1648556961; bh=2/d5Dwa55Lmc6luNWvSogrRhqUZ0yVZDzn/Luqm+vVQ=; h=Subject:From:To:Date:In-Reply-To:References:From; b=aVGHZULAw+A/Y3MAeuJzXcLAc6+n1sz1Lwl4LHKs5AdV0oeoouwqWnrokcLYd5+XG 9tue6c+eaDZplNUO5HOaR4timDxxhqOIBTfzmhJ5FaisxfdjO69WmTRpda3onxcu8t WC+VAJLyuWrvvliXHzt5Ipzngg7PKV+eSEpe0q9g= Message-ID: Subject: Re: ncurses attrset colour pair ignored in favour of bkgd From: Liliana Marie Prikler To: Roman Riabenko , 54607@debbugs.gnu.org Date: Tue, 29 Mar 2022 14:29:20 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54607 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Montag, dem 28.03.2022 um 15:00 +0300 schrieb Roman Riabenko: > gcc test.c -lncurses This is not a sufficient invocation to get ncurses working correctly. $ ncursesw6-config --cflags -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 - I/gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses- 6.2.20210619/include $ ncursesw6-config --libs -L/gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses-6.2.20210619/lib -Wl,-rpath=/gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses- 6.2.20210619/lib -lncursesw $ pkg-config --cflags ncurses -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 - I/gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses- 6.2.20210619/include $ pkg-config --libs ncurses -Wl,-rpath=/gnu/store/9rrnm5hdjw7cy96a2a9rfgh6y08wsbmf-ncurses- 6.2.20210619/lib -lncursesw Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 08:50:15 2022 Received: (at 54607) by debbugs.gnu.org; 7 Apr 2022 12:50:15 +0000 Received: from localhost ([127.0.0.1]:60151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRaY-00087Z-UL for submit@debbugs.gnu.org; Thu, 07 Apr 2022 08:50:15 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:36759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRaW-00087E-JA for 54607@debbugs.gnu.org; Thu, 07 Apr 2022 08:50:13 -0400 Received: (Authenticated sender: roman@riabenko.com) by mail.gandi.net (Postfix) with ESMTPSA id 4F66624000B; Thu, 7 Apr 2022 12:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riabenko.com; s=gm1; t=1649335806; 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=dL6hTvEAcz8zgO2SHk1k4KLTPTMQyftaPkhxTNIcKOU=; b=QcVMCRxAjF1XyCmdIH3wjy2OWws8hL4p5gUnAr9gc6FFgNOxJbOsoG1BOWKXwpVtNSHNqU IGgW5rH5W3B78TVmbBdERjFXuo9OFimwV9xUERQtJKH3GupVJCJKFKAxRjej8KYC58NQ7a wkvsIV5o0kZghZHwjBw+CrXXwrujWhV024QA8x4xXz+7+TqxNJVsceQBQHodp6GQZZ67g0 xwjX+FHbnObviszvbpMdrGy1UGD8LpYV8elCU24DFchXfd17n9YuYLVAjj8HKVlSL7t9kd DJYIhsHCVHP42vJxt15YelhMDi2570dglJSnS64e7neZRoaNQ365w0NP9jrtbA== Message-ID: Subject: Re: ncurses attrset colour pair ignored in favour of bkgd From: Roman Riabenko To: Liliana Marie Prikler , 54607@debbugs.gnu.org Date: Thu, 07 Apr 2022 15:50:03 +0300 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 54607 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Thank you for directing me to those options. Setting _XOPEN_SOURCE to 500 or higher seems to restore the expected functionality of attrset in ncurses for colour. _XOPEN_SOURCE is a feature test macro, so it just determines that some functionality from X/Open is used (X/OPEN 5 for _XOPEN_SOURCE 500, X/OPEN 6 for _XOPEN_SOURCE 600, etc.). The program that is being compiled can have its own tests for functionality that it needs. I can add "#define _XOPEN_SOURCE 500" to the beginning of test.c from my previous email to make it work as it should when built with guix. So, this is something, the program could normally figure out itself without relying on curses being implemented in a specific way. There is a section on alternate configurations of ncurses in its manual [1] noting that it may be necessary for some functionality of ncurses to specify _XOPEN_SOURCE up to 600 for programs compiled against ncurses when the latter was built with --enable-widec. Since this option was chosen for ncurses in guix, it is fair enough that some functionality may need _XOPEN_SOURCE 600, even if I am not sure how my case is related to wide character support or what functionality from X/Open is used. [1]: https://invisible-island.net/ncurses/man/ncurses.3x.html#h2-ALTERNATE-CONFIGURATIONS I believe that the above is enough to close this issue. Roman From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 07 08:52:38 2022 Received: (at 54607-done) by debbugs.gnu.org; 7 Apr 2022 12:52:38 +0000 Received: from localhost ([127.0.0.1]:60155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRcs-0008Az-FL for submit@debbugs.gnu.org; Thu, 07 Apr 2022 08:52:38 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:52290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRcq-0008Aq-2Y for 54607-done@debbugs.gnu.org; Thu, 07 Apr 2022 08:52:37 -0400 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4KZ1W44yjjz3wZp; Thu, 7 Apr 2022 14:52:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1649335952; bh=lhqQefcXL7dk3rI1vW/NLY+DDN5nh7aF/rxP2vn/IdM=; h=Subject:From:To:Date:In-Reply-To:References; b=rcR4tyLj5Mr6LOE6T8HFmh7nPEFsg+jXOwtgRJ0KTwHV+jkkc4/Q2h8DvGHTge2wR HT+bFTvfb8yDpqF5jlAE6TBxwFnlu6enqXrHE9JV55H++L1XUi7rsCZO9N/YNdp5bV N1itbz9uNCJdt2E09azUHSYmwqvEPNL4nK3z+aAQ= Message-ID: Subject: Re: ncurses attrset colour pair ignored in favour of bkgd From: Liliana Marie Prikler To: Roman Riabenko , 54607-done@debbugs.gnu.org Date: Thu, 07 Apr 2022 14:52:31 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54607-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Donnerstag, dem 07.04.2022 um 15:50 +0300 schrieb Roman Riabenko: > I believe that the above is enough to close this issue. Consider it closed. From unknown Tue Aug 19 03:04:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 06 May 2022 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator