Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPython3 broken with winpty running under ConEmu Cygwin connector #102

Open
CMCDragonkai opened this issue Feb 23, 2017 · 6 comments
Open

Comments

@CMCDragonkai
Copy link

Running iPython3 with winpty gives something like this:

%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

?[?25l?[?7l?[0m?[0m?[J?[0;38;5;28mIn [?[0;38;5;10;1m1?[0;38;5;28m]: ?[0m




















?[21A?[8C?[0m?[?12l?[?25h?[?25l?[0me?[0m?[?12l?[?25h?[?25l?[0mx?[0m?[?12l?[?25h?[?25l?[0mi?[0m?[?12l?[?25h?[?25l?[0mt?[0m?[?12l?[?25h?[?25l?[12D?[0m?[J?
[0;38;5;28mIn [?[0;38;5;10;1m1?[0;38;5;28m]: ?[0mexit?[12D?[0m
?[J?[?7h?[0m?[?12l?[?25h%   
@rprichard
Copy link
Owner

I tested this just now, and the issue didn't reproduce for me.

capture

@rprichard
Copy link
Owner

@CMCDragonkai Are you using ConEmu? I am able to reproduce the issue with ConEmu and the Cygwin connector. The ConEmuANSI variable ends up set to ON in the hidden winpty console even though the ConEmu hook is not present (and therefore doesn't provide support for ANSI escape sequences).

@rprichard
Copy link
Owner

I'm guessing ipython uses prompt_toolkit, which decides its output is ConEmu by looking for ConEmuANSI=ON here: https://github.com/jonathanslenders/python-prompt-toolkit/blob/021e6cc963570e1bc645defcdeb2da10d0c83a9e/prompt_toolkit/utils.py#L190

@CMCDragonkai
Copy link
Author

Yep using CONEMU and Cygwin

@rprichard
Copy link
Owner

I considered having winpty clear ConEmu environment variables only when it detected the presence of the ConEmu hook DLL, but that's too conservative a fix -- it's possible for (a) ConEmu to set those variables, then (b) ConEmu starts some other process unhooked, then (c) some descendant eventually starts winpty.exe.

@rprichard
Copy link
Owner

See #106

@rprichard rprichard changed the title Winpty not working with iPython3 iPython3 broken with winpty running under ConEmu Cygwin connector Apr 23, 2017
@rprichard rprichard added the bug label Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants