From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8TdsAE0haWn0CQUAWB0awg (envelope-from ) for ; Thu, 15 Jan 2026 12:18:05 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=lo0CSf3Y; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D99D71E070; Thu, 15 Jan 2026 12:18:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=no autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 58FB61E070 for ; Thu, 15 Jan 2026 12:18:04 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id B297D4BA2E20 for ; Thu, 15 Jan 2026 17:18:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B297D4BA2E20 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=lo0CSf3Y Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 329414BA2E1C for ; Thu, 15 Jan 2026 17:17:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 329414BA2E1C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 329414BA2E1C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768497457; cv=none; b=ga7b7fTZ+Vy/a/2Xez06r86myuJ1SZb7G2DDQPzPE16WpvfeqbRmWxCSZctWX0imXcI4v80oORwKN5yisUuatXac62X2mw71TFKxwmxy7QtQC0gbLUp0FnHpZb3bqWooae5CnTUQZ2g3fTsZSzbKQC0V+01pLW8l3w6o+mUdZ4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768497457; c=relaxed/simple; bh=clyod1Dh0XQwxooQjJRVJ1nzmHcZHklGVxbPOha/v40=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=igAf/SxElEOpCSR+veSa02/tJbdkU2nI8Nuw2FqkcPcaOlTVbKFHGxGI4P12/xNH+3j7DI1hrSrtHgNkHx9KvcTtQXrcoNvLGr8X0qfo/7ogGOMeFQtZRvbnCOzgvGfCFgAQ/uKMMj6AiloF33NWVCRiSvPwDgeEc5rhMMvwwYU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 329414BA2E1C Received: from eig-obgw-6007b.ext.cloudfilter.net ([10.0.30.166]) by cmsmtp with ESMTPS id gGOrvLWBQCxrGgQyWvgTjl; Thu, 15 Jan 2026 17:17:37 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id gQyWvUCGXh8QWgQyWvnCjV; Thu, 15 Jan 2026 17:17:36 +0000 X-Authority-Analysis: v=2.4 cv=Mcdsu4/f c=1 sm=1 tr=0 ts=69692130 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=vUbySO9Y5rIA:10 a=ItBw4LHWJt0A:10 a=20KFwNOVAAAA:8 a=tZBRFekVoGANhJWBUw4A:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=K8iLgJ9j3sRcnzqHvG7+dEeOlKOn2XNYvPvb9xIJxTM=; b=lo0CSf3Yb3VrOuq+dO3qMH2Ty6 0gqA98Rj/kMCDQieS0nTfX4Na1HGHxda17nFjbxGSqB85K06qjw0ozOF0ox1NxJf1zTHBJVLzlUpX 7my7EyVQ1hAiZq1QFg1KqkgPm; Received: from 97-122-114-32.hlrn.qwest.net ([97.122.114.32]:34398 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vgQyV-00000003KbB-41mm; Thu, 15 Jan 2026 10:17:36 -0700 From: Tom Tromey To: Andrew Burgess Cc: Tom Tromey , gdb-patches@sourceware.org, Patryk Sondej Subject: Re: [PATCH] gdb: fix handling of raw ANSI escape sequences printed from Python In-Reply-To: <877btiu8dq.fsf@redhat.com> (Andrew Burgess's message of "Thu, 15 Jan 2026 16:51:29 +0000") References: <2b96eaf47bcb84cf955f4e59ec34c8582b5ceb81.1768475197.git.aburgess@redhat.com> <87h5smg92i.fsf@tromey.com> <877btiu8dq.fsf@redhat.com> X-Attribution: Tom Date: Thu, 15 Jan 2026 10:17:34 -0700 Message-ID: <87cy3ag5ht.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.114.32 X-Source-L: No X-Exim-ID: 1vgQyV-00000003KbB-41mm X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-114-32.hlrn.qwest.net (bapiya) [97.122.114.32]:34398 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLfB2L6NstCzHWZG/Ham4tbMJGsZ2eMWjnt0fqzWDDdLBVwMXrC57IoSzJ6JXfq8NR9sQWMihCGLgGetIq4tb0nMTewnyLBz+wD8rGFbl5HSl9wHr2Ts Fn+DLp5x8VwuwAVjPHW214LPaMWFTamfZ/hN0SfExlLkjHkaGgstaMdX4xjP1LLLSPhQFOB6bsAUDx2lhuyJ3nZvRyUaiBu4UyA= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> "Andrew" == Andrew Burgess writes: >> If the pager is already parsing escape sequences and reacting >> accordingly, then I wonder if there's any need at all for >> ui_file::emit_style_escape. Andrew> I'm not entirely sure what you mean here, but I do wonder if the Andrew> m_applied_style should be moved from ui_file, and ui_file should Andrew> become a pure interface class. This is done in the redirection series :) Anyway what I meant is that I think emit_style_escape is really only implemented in a special way by the pager. The reason for its existence, IIRC, was to track the styles when wrapping. However since the pager already tracks styles in a different way, then it seems like there's no reason for any special code. Andrew> It's kind-of weird that the pager class ends up tracking some state Andrew> within its grandparent's ui_file::m_applied_style, but then it also Andrew> needs to track and mirror some state from within Andrew> m_stream::m_applied_state. Andrew> I wonder if there should be a new class which inherits from ui_file Andrew> which actually implements styling, and would be used for the basic Andrew> streams. I think only the pager really cares so, IMO anyway, it makes sense to leave the logic there. FWIW I have another series in progress that adds styling to error() and it also required some changes to ui-file, though that's mostly templatizing some classes so they can be used in other contexts. Andrew> I'm going to check this in to both master, and the 17 branch. I meant to mention a 17 backport, thanks for doing that. Tom