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

Support mintty on MINGW64 #621

Closed
TicoDePano opened this issue Dec 13, 2017 · 9 comments
Closed

Support mintty on MINGW64 #621

TicoDePano opened this issue Dec 13, 2017 · 9 comments

Comments

@TicoDePano
Copy link

Mintty is installed along with Git for Windows.

Is there any chance to support mintty?

@kbrandwijk
Copy link
Contributor

I don't have issues with mintty on Windows.

@sunrize531
Copy link

sunrize531 commented Feb 25, 2019

I can confirm that in mintty (that comes with git for windows, no additional configuration) moving the cursor with arrows in prompts doesn't work at all. mintty tries to emulate xterm terminal, so I'd guess there would be some problems with xterm as well?

@sunrize531
Copy link

So, more info on this. When script with inquirer prompt in it called directly - it works perfectly fine in mintty too. But if the same script called via npm run in mintty running gitbash - it's completely screwed. Arrows don't work, you can't even close it with Ctrl-C and also the output lacks colours. Probably something to do with stdout/stdin pipes in mintty.

@bitmvr
Copy link

bitmvr commented Mar 20, 2019

I can second what @sunrize531 mentioned above.

If Inquirer is using prompts, this thread may be of value.

terkelg/prompts#36

@Zamiell
Copy link

Zamiell commented Oct 19, 2020

using this on Git Bash for Windows also duplicates the questions, making the library look extremely buggy

e.g.

? Would you like to create a config file? (Y/n)    # press enter to use the default
? Would you like to create a config file? Yes

@Zamiell
Copy link

Zamiell commented Oct 19, 2020

looks like this is related to #432

@Zamiell
Copy link

Zamiell commented Dec 8, 2021

I noticed that Inquirer was NOT duplicating text in a simple test repository, but was duplicating text in my real app, so I did some investigating.

The issue seems to be because:

  • when you type npx foo
  • it invokes a shell script located at C:\Users\[Username]\AppData\Roaming\npm\foo.cmd
  • which contains a line that invokes node like this:
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\test\dist\main.js" %*`

Essentially, this command ends up up being: "node" "path/to/foo.js"

When I take off the quotation marks around the "node" command, the bug seems to go away, as demonstrated by the following screenshot:

image

Pardon my French, but why the fuck is this happening? Why does putting quotation marks around node change the behavior of the resulting program? And is there some kind of fix that I can include in my JavaScript code to work around this problem?

@lbglb
Copy link

lbglb commented Apr 20, 2023

Why does putting quotation marks around node change the behavior of the resulting program?

Running node without quotes will respect the alias if there is one (check by running alias node).. Running "node" with quotes ignores the alias.

@SBoudrias
Copy link
Owner

Anyone narrowed down exactly what happens and how to fix/run the script with proper streams and/or interactive tty?

I'd be happy to document this in the README to help anyone running into this issue 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

7 participants