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

ANSI/VT escape codes not forwarded correctly #490

Open
LinqLover opened this issue Jan 22, 2025 · 0 comments
Open

ANSI/VT escape codes not forwarded correctly #490

LinqLover opened this issue Jan 22, 2025 · 0 comments

Comments

@LinqLover
Copy link

Windows 11 24H2, Python 3.13, running in Windows Terminal from PowerShell, pywinpty version 2.0.14

In the REPL, run:

from winpty import PtyProcess
p = PtyProcess.spawn(['python3', '-c', 'print("\033[94mHi\033[0m")'])
while not p.eof(): print(p.readline())
    print("done")

Expected output (color annotations mine):

Hi   (blue)

done   (default color)

Actual output (color annotations mine):

Hi   (blue)


done    (blue)

Image

Workaround:

p = PtyProcess.spawn(['python3', '-c', 'print("\033[94mHi\033[0m ")'])

Note the trailing space after the last VT code, which ensures that the escape sequence is actually applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant