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

default msys2 console is unusable in win10 #1633

Closed
pps83 opened this issue Aug 13, 2016 · 9 comments
Closed

default msys2 console is unusable in win10 #1633

pps83 opened this issue Aug 13, 2016 · 9 comments

Comments

@pps83
Copy link

pps83 commented Aug 13, 2016

something is wrong with default msys2 console window on win10 (not sure if that's win10 specific). If I open msys2 console (which uses mintty by default) then i cannot use any interpreters the way it used work. For example, if I simply run node then I can type wherever I want there and nothing will happen, as if nothing was entered, no js gets executed. Same problem with perl. In my case node is regular win32 isntall of node, perl is msys perl. If I use non mintty terminal, then everything works as expected.

On top of that, after updating to latest msys I had to uncomment set MSYS2_PATH_TYPE=inherit to ensure that node can be found. By default msys2_shell start mintty: if NOT EXIST "%WD%mintty.exe" goto startsh, but if you change it to always startsh then it won't use mintty and default bash will be used, which to me looks now identical to mintty, not even shure what the difference now, except that node and perl in interactive mode work properly

@pps83 pps83 closed this as completed Aug 13, 2016
@pps83 pps83 reopened this Aug 13, 2016
@jtanx
Copy link
Contributor

jtanx commented Aug 15, 2016

Try installing winpty (pacman -S winpty) and running the command like winpty node

@mingwandroid
Copy link
Member

There is a fix in git for detecting if the standard handles are connected to a named pipe and the name is checked to see if it is a Cygwin pipe. It might be worth turning this into a new msys2_isatty() function and using that in all the packages that have this problem. We would need to ask for very liberal licensing permission for that though so that we can use it everywhere, or else we'd need to write our own version without reference to the original.

@pps83
Copy link
Author

pps83 commented Aug 16, 2016

regarding winpty node - I think it's quite strange that normal commands will need to be run that way. Default console in msys2 should behave properly, just like everyone expects.

@DavidEGrayson
Copy link
Sponsor Contributor

It depends what your definition of "normal commands" is. Programs that run under the msys-2.0.dll/Cygwin POSIX emulation environment will work fine in MinTTY. Native Windows programs like node, or anything in /mingw64/bin or /mingw32/bin are from a different runtime environment so they are not perfectly compatible with msys-2.0.dll/Cygwin.

@DavidEGrayson
Copy link
Sponsor Contributor

DavidEGrayson commented Aug 16, 2016

You can run MSYS2 in a native Windows console instead of MinTTY, which should allow interactive native Windows programs to work better. I know that MinGW interactive Ruby (irb) works better. I use this simple batch script to launch MSYS2 and one of the features is that I can select which terminal to use:

https://gist.github.com/DavidEGrayson/2e5923b9c0d8acb3f7a7

@pps83
Copy link
Author

pps83 commented Aug 17, 2016

@DavidEGrayson did it always have that problem with "normal commands", or it's something that was introduced recently? Maybe I haven't noticed that before if the problem always existed.

@DavidEGrayson
Copy link
Sponsor Contributor

DavidEGrayson commented Aug 17, 2016

I think it has not changed recently. The isatty function called by MinGW programs comes from Microsoft's msvcrt.dll so it doesn't know about or support msys-2.0/Cygwin and I doubt there were any recent changes to it.

@pps83
Copy link
Author

pps83 commented Aug 17, 2016

Well, anyways, I've made some changes in my msys2_shell.cmd and I have no problems and everything works perfectly. First of all, I did this (with new msys2 update lots of functionality stopped working for me because of this change):

rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
rem or uncomment next line
set MSYS2_PATH_TYPE=inherit

and second thing, i changed if NOT EXIST "%WD%mintty.exe" goto startsh to goto startsh and everything works perfectly for me, regular node etc, and console behaves well, just like regular putty.

@MehdiChinoune
Copy link
Collaborator

nodejs is no longer available.

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

5 participants