Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue-cli: arrow key not working while creating new project on git bash windows

I am trying to create a project which Vue-cli through Git bash Window.

Git version 2.14.1.windows.1

Vue version 3.0.0-rc.3

For some reason the cursor is still visible during installation.

enter image description here

And when I press any arrow key, the option does not change, only the cursor move around. (However, pressing enter still process me to the next step).

Searching for a solution with google does not let me anywhere, only a few Github bug report: https://github.com/vuejs/vue-devtools/issues/283

like image 476
Lê Quang Bảo Avatar asked Jul 12 '18 03:07

Lê Quang Bảo


People also ask

How do I use arrow keys in Git bash?

When in Git bash and prompted for an answer by arrow key selection. You have to first type '>' and look at what line it typed on(usually the first line). The goal is to get that greater than symbol on the current line selected. In my case I had to press the down arrow to get it on the 'apps' selection line.

Which command is required to create a project using vue CLI?

vue create You must launch the command as winpty vue. cmd create hello-world . If you however want to still use the vue create hello-world syntax, you can alias the command by adding the following line to your ~/. bashrc file.


1 Answers

UPDATED 2021, Apr 4th!

Here's a CTRL+C and CTRL+V step-by-step practical solution to solve this. The fact that you have this trouble means you are on Windows and you most likely use Git Bash.

  1. Using Git Bash a quick solution would be typing
    echo 'alias vue="winpty vue.cmd"' >> ~/.bashrc
    This will not overwrite .bashrc, and instead append the text on the left of >>
  2. Restart your bash. That means close it and open it again.

If you're looking for "Why do I have to add such thing to .bashrc?", I think another user has mentioned that. If you found this helpful please upvote it so others can see it too.

Old answer

You can try to make a file .bashrc in your current <UserNameProfile>.
Then, inside of it use your favourite text editor and write

alias vue='winpty vue.cmd'

Then restart your bash. And you should be able to use vue as it should be on the documentation.

like image 182
Irfandy Jip Avatar answered Sep 20 '22 13:09

Irfandy Jip