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

bug: does not work on Git Bash #1139

Closed
Zamiell opened this issue Jan 29, 2023 · 6 comments · Fixed by #1222
Closed

bug: does not work on Git Bash #1139

Zamiell opened this issue Jan 29, 2023 · 6 comments · Fixed by #1222
Labels
🐞 confirmed bug Something isn't working 🛑 wontfix This will not be worked on

Comments

@Zamiell
Copy link
Contributor

Zamiell commented Jan 29, 2023

Provide environment information

$ npx envinfo --system --binaries
npm WARN exec The following package was not found and will be installed: [email protected]

System:
OS: Windows 10 10.0.19044
CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
Memory: 21.04 GB / 31.93 GB
Binaries:
Node: 18.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~.yarn\bin\yarn.CMD
npm: 9.3.0 - C:\Program Files\nodejs\npm.CMD

Describe the bug

Whatever library you are using to generate the prompts does not work on Git Bash for Windows.

image

Here, no matter what buttons I press, the arrows don't move, and so on.

Reproduction repo

n/a

To reproduce

  1. Install Windows 10.
  2. Install Node JS.
  3. Install Git.
  4. Open Git Bash.
  5. Type npm create t3-app@latest foo

Additional information

n/a

@royanger
Copy link

git bash is horrible, but it works. There is a cursor at the end of the line that you can move up and down. When you select something it doesn't properly highlight/select it.

$ npm create t3-app@latest test
   ___ ___ ___   __ _____ ___   _____ ____    __   ___ ___
  / __| _ \ __| /  \_   _| __| |_   _|__ /   /  \ | _ \ _ \
 | (__|   / _| / /\ \| | | _|    | |  |_ \  / /\ \|  _/  _/
  \___|_|_\___|_/‾‾\_\_| |___|   |_| |___/ /_/‾‾\_\_| |_|


? Will you be using TypeScript or JavaScript? (Use arrow keys)
? Will you be using TypeScript or JavaScript? TypeScript
Good choice! Using TypeScript!
? Which packages would you like to enable? tailwind, trpc
? Initialize a new git repository? (Y/n)

You can see from the above I was able to select JavaScript and use arrows and space to select only 'trpc' and 'tailwind' from the list.

I strongly suggest using the Windows Terminal app. It far exceeds git bash and I am able to easily navigate the menus in the T3 CLI.

@Zamiell
Copy link
Contributor Author

Zamiell commented Jan 29, 2023

You can see from the above I was able to select JavaScript and use arrows and space to select only 'trpc' and 'tailwind' from the list.

for the purposes of this issue, i dont think that we should consider "ghost inputs" to be classified as working, as the end-user will obviously have no idea that they are working.

I strongly suggest using the Windows Terminal app

windows terminal doesn't have any of the bash builtins though (grep, find, sed, less, etc.), so it is basically unusable.

@royanger
Copy link

i dont think that we should consider "ghost inputs" to be classified as working

The CLI does work, but the terminal is handling it poorly. Powershell, Command Prompt, Ubuntu Terminal, Developer Command Prompt for VS 2022 and Developer Powershell for VS 2022 all worked fine.

Also npx create-remix@latest and npm create astro@latest (and no doubt others) have the same problem.

(grep, find, sed, less, etc. There are ways to do this stuff in Powershell. I also highly recommend Windows Terminal with WSL. However, I don't think this Issue is a place to talk about sed, grep, etc.

@Zamiell Zamiell changed the title bug: does not work on windows bug: does not work on Git Bash Jan 29, 2023
@c-ehrlich
Copy link
Member

Both inquirer and prompts, by far the two most popular packages for building CLI apps in node, are broken in git-bash. We would probably need to fully rewrite the CLI in something else in order to support a terminal that not many people use. A good compromise might be to detect git-bash and suggest the user to use something else, similar to what we already do for yarn 2/3 and used to do for node 18.

@iAverages
Copy link
Contributor

iAverages commented Feb 4, 2023

You can see from the above I was able to select JavaScript and use arrows and space to select only 'trpc' and 'tailwind' from the list.

for the purposes of this issue, i dont think that we should consider "ghost inputs" to be classified as working, as the end-user will obviously have no idea that they are working.

I strongly suggest using the Windows Terminal app

windows terminal doesn't have any of the bash builtins though (grep, find, sed, less, etc.), so it is basically unusable.

You can use git bash with the built-in terminal to VSC or Windows Terminal (just bash on Windows at this point) and both seem to handle input correctly with the ct3a cli.

I believe the main issue here isn't git bash but instead, the default terminal that git bash uses (MinTTY) which you can change during the installation.

VSC:
vscode

Windows Terminal:
windows terminal

@juliusmarminge juliusmarminge added 🛑 wontfix This will not be worked on and removed 🐞❔ unconfirmed bug labels Feb 16, 2023
@juliusmarminge
Copy link
Member

Seems like no prompt library support this so the best thing we can do is try detecting it and just quitting with a good message - but we wont try working around the prompt libraries and support this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 confirmed bug Something isn't working 🛑 wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants