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

Running node from vim complains about tty #705

Closed
timmyL17 opened this issue Oct 13, 2016 · 3 comments
Closed

Running node from vim complains about tty #705

timmyL17 opened this issue Oct 13, 2016 · 3 comments

Comments

@timmyL17
Copy link

Hi,

I'm trying to use the syntastic plugin for vim for syntax checking of files. For javascript, I'm trying to use jshint, which uses node.js. When I run node from the msys2 terminal, everything seems fine:

$ node -p -e "Boolean(process.stdin.isTTY)"
true
However, when I try to run node from inside vim:

:echo system('node')
It prints the error stdin is not a tty . So the syntax checking through syntastic won't work correctly.

When I was using cygwin 2 months ago, calling node from inside vim worked perfectly. I switched to msys2 because it was faster and smaller than cygwin. Is there a fundamental difference between the two that is causing this issue?

This problem has existed since I installed msys2 over a month ago, so I don't think it is due to the recent vim 8 version update this past week.

Thanks.

@timmyL17
Copy link
Author

Also, in an up to date Archlinux system, this works correctly. So it seems to be specific to msys2.

@forgottenswitch
Copy link
Contributor

forgottenswitch commented Nov 4, 2016

Edit: this comment duplicates https://sourceforge.net/p/msys2/wiki/Porting/#standard-streams-in-mintty

Node is a mingw package, which means it uses win32 runtime, which ignores MSYS2 stdin/out/err,
thinking they are just *-pty-* pipes.
The msys2 and cygwin runtimes (msys2.dll) check for the "-pty-" and perform isatty(), etc. correctly.

So you either need to run a mingw32/64 vim in a Command Prompt window,
or install nodejs from source in Msys2 shell
(or patch Mingw node to check for "-pty-").

On Linux it works because there is no need to emulate pty's with named pipes.

For Command Prompt, do set PATH=%PATH%;C:WhereMsys2Is\mingwYZ\bin, or it would complain about random dlls not being found.

This should be enough to close this issue.
It has been hit elsewhere, through.

@timmyL17
Copy link
Author

timmyL17 commented Nov 4, 2016

Thanks for the explanation. I tried building it from source in an MSYS2 shell, but there were a bunch of errors out of the box. I'll try looking more in depth if I have time in the future.

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

2 participants