Ionic-cli: CLI item selection doesn't work property using Git Bash

Created on 16 Oct 2017  路  6Comments  路  Source: ionic-team/ionic-cli

_From @ciaran036 on October 14, 2017 15:3_

Ionic version:
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)

  • [ ] 2.x
  • [x] 3.x
  • [ ] 4.x

I'm submitting a ... (check one with "x")

  • [x] bug report
  • [ ] feature request

Current behavior:
When using Git Bash on Windows, when the Ionic CLI prompts for the user to make a selection, Ionic will choose the wrong item from the one I actually selected.

gitbash

Expected behavior:
When I move the cursor to a particular item, Ionic should actually perform the action for the correct selection.

Steps to reproduce:
1) Open a Git Bash terminal on Windows
2) Type any command which prompts for a selection, e.g. "ionic start myApp"
3) By using the keyboard to move the cursor to select an item, when the Enter key is pressed, Ionic will take the wrong option to the one I actually selected.

I've found that if I use Powershell I can select items successfully (although I'd prefer to use Git Bash so I can use Git commands easily).

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (C:\Users\Ciaran\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.13.0
    ionic (Ionic CLI) : 3.13.0

System:

    Node : v8.6.0
    npm  : 5.3.0
    OS   : Windows 10

Misc:

    backend : pro

_Copied from original issue: ionic-team/ionic#13147_

All 6 comments

Hello! Thank you for opening an issue with us!

This does not appear to be an issue with the Ionic Framework but with the Ionic CLI. I will move it to the CLI repo. Please track the new issue over there.

Thank you for using Ionic

@ciaran036 We use Inquirer.js for these interactive prompts. Please see this issue: https://github.com/SBoudrias/Inquirer.js/issues/570

For interactivity to work, it looks like Git Bash isn't an option. You can try a different shell (perhaps the native Windows 10 Bash?) or use --no-interactive mode on while specifying the parameters.

Thank you so much for the help @dwieeb I hadn't realised Windows 10 Bash was at my fingertips already.

another option is a bit of a tweak just

while in the selection menu option in Git bash
move your cursor to the list of items and then
use the backspace key to clear the other options away until u left with option of your choice
(cursor flexibility is enabled when one of multiple choices is to be taken)

worked for me

The best option I found thus far is:

All interaction will work as expected while still keeping the benefits of Git Bash 馃拑

If you have bash as a VS Code terminal, running interactive commands there will work also.

Was this page helpful?
0 / 5 - 0 ratings