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

Redirecting output of winpty to file #100

Closed
sanguine8082 opened this issue Jan 27, 2017 · 5 comments
Closed

Redirecting output of winpty to file #100

sanguine8082 opened this issue Jan 27, 2017 · 5 comments

Comments

@sanguine8082
Copy link

I'm calling a python script using winpty; I'd like to do the following:

winpty /path/to/python script.py | tee output.txt

When I try to do this, I receive a message saying "stdout is not a tty". I'm calling this python script from a mintty console. Is there anyway to pipe output from winpty's pipe into an output file that I can read?

I have requirements that prevent me from using Cygwin's Python version. We use a portable version of python that I have to be able to resolve to using a shebang in my script.

@rprichard
Copy link
Owner

rprichard commented Jan 28, 2017

This issue reminds me of #93. You might be able to use -Xallow-non-pty for now at least.

(2017-01-30 edit: -Xallow-non-pty was a typo -- the actual option name is -Xallow-non-tty.)

@sanguine8082
Copy link
Author

That would be a negative good sir:

winpty -Xallow-non-pty ../io.github.winpython/oss/winpython/python-2.7.10.amd64/python.exe ./test.py
Error: unrecognized option: '-Xallow-non-pty'

Calling from the git for windows MinTTY Git Bash.

@rprichard
Copy link
Owner

Sorry, I meant -Xallow-non-tty. (tty vs pty)

@sanguine8082
Copy link
Author

😧

I've been bamboozled!

It works now; thank you for looking into this. I really appreciate it.

@ahridin
Copy link

ahridin commented Feb 14, 2020

Add both '-Xallow-non-tty' and '-Xplain' to prevent ASCII escape characters

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

3 participants