Problems encountered
Windows uses Git bash to execute commands, some of which require the user to select options. At this point, however, you can’t use the up and down keys on the keyboard to select options, which is awkward.
For example, when we use vue-CLI to create a project, the first step looks like this
vue create my-project
Copy the code
When you press Enter, the console presents multiple options for the user to choose from.
The problem is that you can’t select the option you want by pressing up and down on the keyboard.
What to do? Take a look at the solution below.
The solution
1. Use numeric keys to select a value.
So what we see is this, > this right Angle bracket points to the first one.
To select Node-sass, type 2 and press Enter.
To select Default (Vue 3 Preview) ([Vue 3] bable, ESLint), type 5 and press Enter.
2. Run the winpty command
Winpty is a Windows software package, provides a similar interface to Unix PTY -master, used to achieve communication between console programs. The package includes a development library (libwinpty) and a tool for ygwin and MSYS for running Windows console programs under Cygwin/MSYS PTY.
Winpty: error: cannot start ‘vue’: Not found in PATH Note, it will look for the following instruction in PATH.
To use Winpty, you usually need to add the.cmd suffix to the regular command
winpty vue.cmd create my-project
Copy the code
After this execution, you can select by keyboard up and down keys.
Vue-cli official website provides the following solutions:
3. Change git bash to CMD
After changing to CMD, there is a highlighting function, you can select directly by keyboard up and down keys.
4. Use bash in vscode
In VSCode, git bash is set to the default shell, so that commands can be executed in bash and options can be selected using the up and down keys on the keyboard.