From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102091 invoked by alias); 1 Mar 2019 18:42:43 -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 102021 invoked by uid 89); 1 Mar 2019 18:42:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=(unknown) X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.150.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Mar 2019 18:42:41 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 8F85C13B08 for ; Fri, 1 Mar 2019 12:42:40 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id zn7IgMYZh2qH7zn7IgrR3z; Fri, 01 Mar 2019 12:42:40 -0600 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:In-Reply-To:Date: References: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=vsIIz9kaMShFnr7UTrWwihyxa1sEPDcEarg9GCpLe5w=; b=V6UmhrKsYA5gj3kN0kmkBrjakp HuyM5XcMRdklPgThni7p3bd15N485qcBy0Rx3mod/cixLKmQxaSU1bx9SmjwU77E3wImdNX9iStW+ 3j3hSIsNPyMM/Q3ftUkU7MNW0; Received: from 75-166-85-218.hlrn.qwest.net ([75.166.85.218]:33636 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gzn7I-001b19-Br; Fri, 01 Mar 2019 12:42:40 -0600 From: Tom Tromey To: Eli Zaretskii Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 00/16] Add styling to the gdb CLI and TUI References: <20181128001435.12703-1-tom@tromey.com> <83k1kxfzwo.fsf@gnu.org> <8736rja4i8.fsf@tromey.com> <83r2brhw8k.fsf@gnu.org> Date: Fri, 01 Mar 2019 18:42:00 -0000 In-Reply-To: <83r2brhw8k.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Mar 2019 09:47:23 +0200") Message-ID: <87h8cmh1wg.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-03/txt/msg00012.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: >> I think either utils.c would have to be modified to change where it >> sends output, or stdio_file::puts would have to be modified. The idea >> there would be to call a host-specific function; and then on Windows do >> the filtering+styling if the output is going to the terminal. Eli> I'm looking into this now. The simplest change would be to modify Eli> stdio_file::puts that performs the filtering only on Windows, but the Eli> fact that you mentioned calling a host-specific function confuses me a Eli> little. Can you elaborate on what you had in mind, and specifically Eli> what kind of a host-specific function should be involved here, and Eli> how? Right now styling works because, in the end, ANSI escape sequences are emitted via stdio_file::puts, which just calls fputs. However, my understanding is that the Windows console instead requires styling to be done by making various API calls. So, the idea is to replace stdio_file::puts with a function that, for the Windows console only, parses out the ANSI escapes from the output string and replaces those with the appropriate API calls. This made sense to me as a host-dependent function of some kind. But I don't really know. The TUI does essentially this in order to convert ANSI escapes into curses calls. See tui-io.c:tui_puts_internal and apply_ansi_escape. The parsing work is done by the method ui_file_style::parse. Tom