From: Tom Tromey <tom@tromey.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFC] Fix pager bugs with style output
Date: Sun, 17 Feb 2019 15:34:00 -0000 [thread overview]
Message-ID: <871s46mnsz.fsf@tromey.com> (raw)
In-Reply-To: <20190217123121.GB8537@adacore.com> (Joel Brobecker's message of "Sun, 17 Feb 2019 16:31:21 +0400")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> One thought, perhaps: Would it make sense to call can_emit_style_escape
Joel> inside emit_style_escape? I'm not entirely sure whether this would
Joel> always work or not. On the one hand, the issue with relying on callers
Joel> of emit_style_escape to verify that it makes sense is that we're bound
Joel> to forget again in the future. On the other hand, I'm trying to think
Joel> what would happen is a user changed XTERM from xterm to dump, for
Joel> instance. Normally, we should always be in the normal style when the
Joel> user has the prompt, so there would be no need to reset it back to
Joel> the default style. One thing I did notice is that a couple of calls
Joel> to emit_style_escape are unprotected in prompt_for_continue: From
Joel> what I can tell, it seems like we'd be emitting ansi sequences when
Joel> in fact we shouldn't?
This is all more subtle than I would like :(
The call to emit_style_escape in set_output_style deliberately does not
pass the stream argument. But, it does test can_emit_style_escape on
the stream. Changing this causes regressions because now the output
won't end up in the wrap buffer. I added a comment to set_output_style.
The calls to in prompt_for_continue do indeed need protection now that
the caching is gone. I've fixed these. Also they were emitting to the
wrap buffer, which seems wrong (at least for the first one), because the
wrap buffer isn't flushed here.
There are still mysteries in here to me, too, like why one call to
prompt_for_continue checks "filter" but the other does not.
Tom
prev parent reply other threads:[~2019-02-17 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 18:37 Tom Tromey
2019-02-10 12:38 ` Joel Brobecker
2019-02-12 13:53 ` Andrew Burgess
2019-02-12 17:08 ` Tom Tromey
2019-02-14 3:34 ` Joel Brobecker
2019-02-12 17:13 ` Tom Tromey
2019-02-12 18:22 ` Tom Tromey
2019-02-17 12:31 ` Joel Brobecker
2019-02-17 15:34 ` Tom Tromey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871s46mnsz.fsf@tromey.com \
--to=tom@tromey.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox