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

Luvit's global print replacement (from deps/pretty-print) fails when trying to pipe the output on Windows #1163

Open
Duckwhale opened this issue Oct 16, 2021 · 0 comments
Labels

Comments

@Duckwhale
Copy link

Example code:

print("Hello world")

Running it with luvit test.lua works, but when trying to re-route the output via luvit test.lua > test.log it fails:

image

Expected behavior:

  • No console output (as STDIN should be re-routed to the file)
  • test.log contains the text "Hello world"

Actual behavior:

  • The above console output
  • test.log is empty

Additional information:

  • This appears to be independent of the terminal used; I tried it with both the default cmd and my usual Cmder shell.
  • When trying luvit test.lua | tee test.log it does work as expected (tee is included in cmder/cygwin, not cmd)
  • In fact, even luvit test.lua | test.log seems to work without errors, though it opens the editor window afterwards

Relevant code:

if uv.guess_handle(uv.fileno(fs))=='tty' then

@squeek502 squeek502 added the bug label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants