[Tutor] Output not legible when debugging with ipdb

Walter Prins wprins at gmail.com
Tue Nov 26 22:28:03 CET 2013


Hi,

On 26 November 2013 19:01, eryksun <eryksun at gmail.com> wrote:

> On Tue, Nov 26, 2013 at 11:50 AM, Walter Prins <wprins at gmail.com> wrote:
> > All those arrows and codes you see are called "ANSI escape codes" or
> "ANSI
> > control codes".  It's a way to control/signal text colour and formatting
> > inline for text terminals.  I don't know whether or not it does, but if
> > Windows Powershell does not support ANSI escape codes then I'd expect the
> > above style of output, so either it doesn't support it, or it does but
> isn't
> > enabled.
>
> Windows Powershell is just another console program. It's waiting in
> the background for IPython to close. The console window is hosted by
> csrss.exe (NT 3.1-6.0) or conhost.exe (NT 6.1+). But otherwise you're
> correct that a Windows console window doesn't grok terminal escape
> sequences (its API is instead based on kernel32 functions). With
> ConEmu, the original console window still exists (for standard I/O),
> but it's hiding in shame.
>

Thanks for clarifying some of the underlying details though the
point/implications of the details you're giving went over my head to be
honest.  Regarding Powershell (vs for example cmd.exe): The (slightly)
perplexing/irritating/annoying thing is that the older cmd.exe shell, which
uses a standard old-school NT console window, does support ANSI escape
sequences (but is otherwise pretty braindead IMHO, for example does not
support arbitrary resizing, copy and paste is clunky and so on), while the
text mode/console window hosting Powershell behaves somewhat differently,
and is (IIRC) at least resizable, but apparently doesn't support escape
sequences, so there appears to be some differences -- though I realize
these must be due to features in the shells themselves since they share
some common console window functionality.

Anyway, my real point/suggestion was that the OP's problem with IPython's
colourized output will be most easily solved by ensuring you have something
in the terminal pipleine that will interpret ANSI escape sequences, and
that one of the best ways to achieve that is to use an aftermarket
terminal/console emulator (which for that matter can server for Powershell
as well if that's your thing.) :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131126/e40e62f0/attachment.html>


More information about the Tutor mailing list