From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65895 invoked by alias); 7 Sep 2018 06:23:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 65871 invoked by uid 89); 7 Sep 2018 06:23:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Sep 2018 06:23:44 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyAB9-0004FJ-Q4 for gdb-patches@sourceware.org; Fri, 07 Sep 2018 02:23:42 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33819) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyAB9-0004El-Lz; Fri, 07 Sep 2018 02:23:39 -0400 Received: from [176.228.60.248] (port=3803 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fyAB9-0006Ld-8m; Fri, 07 Sep 2018 02:23:39 -0400 Date: Fri, 07 Sep 2018 06:23:00 -0000 Message-Id: <83r2i5vn9w.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey CC: gdb-patches@sourceware.org In-reply-to: <20180906211303.11029-1-tom@tromey.com> (message from Tom Tromey on Thu, 6 Sep 2018 15:12:55 -0600) Subject: Re: [RFC 0/8] add terminal styling to gdb References: <20180906211303.11029-1-tom@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00115.txt.bz2 > From: Tom Tromey > Date: Thu, 6 Sep 2018 15:12:55 -0600 > > I've wanted gdb to use colors on the terminal for a while now. I've > actually tried implementing this a few different ways at different > times, the most successful approach so far being a colorizing frame > filter. > > This series takes a more direct approach, namely integrating the code > into gdb. The basic approach is to have gdb know how to emit ANSI > terminal escape codes to control the color and style (currently just > the intensity). Then, cli-out is changed to style certain fields as > it emits them. However, because some places do not use ui-out, some > ad hoc changes are also done. This is a worthy goal, IMO, but please allow a level of abstraction between output styles and ANSI escape sequences. In particular, the assumption that changing a style or switching text attributes (like color, bold, etc.) requires to "emit" something to the terminal, is not necessarily true. Please allow for terminals where doing that requires a function call that doesn't necessarily write anything to the terminal. Another, perhaps alternative possibility, would be to use curses/ncurses features for controlling text color. Finally, did you consider the use case of running GDB from Emacs (via the old GUD, which uses CLI I/O)? Would the color escapes be disabled in that case, or would that require Emacs to interpret them? Same question for other front-ends which use CLI, if there are such. Thanks.