Terry J. Reedy added the comment:
In #30075, Tithen Firion reports that "subprocess.call('', shell=True)" leaves
the console in ANSI mode. In Eryk Sun says that this is likely a bug in
cmd.exe and gives improved code for putting the console in VT mode, when this
is possible. I closed that
Steve Dower added the comment:
> IIRC, ANSI is somewhat incompatible with sending random binary gibberish to
> the screen, as people accidentally do with TYPE sometimes :) But the random
> binary gibberish may contain ANSI control sequences... That's why I'm
> negative on making it a default.
Glenn Linderman added the comment:
Re: curses... maybe that becomes a DOCS issue, to mention the available
packages. But it would be easier, no doubt to port curses to a known existing
escape sequence control set, than to use a bunch arcane,
foreign-to-the-Unix-porter-that-wants-curses
Steve Dower added the comment:
I suspect curses could be updated to fully support Windows, even without the
VT100 mode (all the functionality has existed for years, just through a
different interface). It really just needs someone to take on the project, and
there are already better options
Glenn Linderman added the comment:
Nice idea, but not by default. An easy way to switch back and forth, and to be
sure the original mode is restored on process exit would be a win.
Most windows users want a real GUI, not curses, but compatibility with VT
escape codes for cross-platform
Eryk Sun added the comment:
> As there is no good interface in core Python to the kernel32 console
> operations (and there probably shouldn't be, it would be better to be
> consistent), I suggest just flipping the bit at startup on Windows.
I don't follow your statement about consistency.
Steve Dower added the comment:
Sounds good. Don't focus on ease of implementation, BTW. The post and eventual
PEP need to cover the benefits, risks and alternatives more than anything else.
--
___
Python tracker
Joseph Hackman added the comment:
Thanks for the tip! If you hadn't said that, I probably would have written it
into the init scripts.
I'll try to write something for python-ideas / PEP tomorrow, but have attached
a quick patch here so I can link to this issue for an example implementation.
Steve Dower added the comment:
Oh, and it should go in the WinConsoleIO class, needs to be written in C, and
probably needs a short PEP explaining why it has to be on by default and can't
be turned on by programs that need it. I'm sure the discussion will lead to
other ideas as well (perhaps
Steve Dower added the comment:
Great suggestion. If someone is willing to contribute the work then we can
consider it for 3.7.
If you need this functionality sooner, either ctypes or colorama should allow
you to use it on existing releases.
--
type: behavior -> enhancement
versions:
Joseph Hackman added the comment:
The flag is application specific. I.e. a python program that writes to console
using ansi codes, when used on windows, will just display the codes. If the
Output is redireced to file and then the file is printed to console using a
console tool, the colors
INADA Naoki added the comment:
Is it a global state, or application specific state?
In other words, if Python enables VT100, doesn't it remain after os._exit(1)?
If it is global state of console, why Python should change it?
Shouldn't user who want to use VT100 enable it before starting Python?
New submission from Joseph Hackman:
On windows, Python does not request that Windows enable VT100 for console
output for Python.
That is to say that ANSI codes such as \033[91m will function on Mac and Linux
Pythons, but not Windows.
As there is no good interface in core Python to the
13 matches
Mail list logo