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

Arrow keys for selecting options doesn't work in Windows #303

Closed
nmai opened this issue Nov 14, 2015 · 9 comments
Closed

Arrow keys for selecting options doesn't work in Windows #303

nmai opened this issue Nov 14, 2015 · 9 comments

Comments

@nmai
Copy link

nmai commented Nov 14, 2015

This issue is directly related: eslint/eslint#3880

Pressing the arrow keys does nothing. Running node.js v4.1.2 under Windows 8.1.

@SBoudrias
Copy link
Owner

Duplicate of #266 - you have the full background of the issue there and Node.js fixed the issue on their master branch.

@nmai
Copy link
Author

nmai commented Nov 14, 2015

@SBoudrias Thank you, and my apologies for creating a duplicate. I upgraded to Node 5.0.0 in hopes that it would have the latest patch. It did not. Hopefully they'll roll out the fix in the coming days.

I discovered that the arrow keys worked perfectly fine in https://github.com/Maximus5/ConEmu but the default Windows command prompt, Node.js command prompt, and Git command prompt all failed.

tl;dr: The only solution to this problem is to use ConEmu or generate the .eslintrc file yoursef, at least until a fix is released by the Node team.

Or just use a better shell environment, such the ones offered by Linux and OS X 👍

@Spaider
Copy link

Spaider commented Nov 21, 2015

For some reason, ConEmu does not always work as well. I did not investigate it a lot, but it worked for me only for non-admin console.

@Amberlamps
Copy link

I am running Node in 5.0.0 on Windows 8.1. Arrow keys do not work in this simple example:

var questions = [
  {
    type: "list",
    name: "color",
    message: "Pick a color",
    choices: ['red', 'green', 'blue']
  }
];

inquirer.prompt(questions, (answers) => {
  console.log(answers);
});

But when I add a simple boolean it magically works. Maybe this sheds a little light on this issue.

var questions = [
  {
    type: "confirm",
    name: "mood",
    message: "Are you feeling alright?",
    default: true
  },
  {
    type: "list",
    name: "color",
    message: "Pick a color",
    choices: ['red', 'green', 'blue']
  }
];

inquirer.prompt(questions, (answers) => {
  console.log(answers);
});

@SBoudrias
Copy link
Owner

@Amberlamps please see related issues. It's all explained in deep. Node release a bug causing a race condition who's not creating keypress events on windows.

@geddski
Copy link

geddski commented Apr 28, 2016

Here's a workaround for anyone that needs it. https://gist.github.com/geddski/c42feb364f3c671d22b6390d82b8af8f

@Jeff-Lewis
Copy link

Also see nodejs/node#5384

@jokeyrhyme
Copy link

I have a module that helps identify broken versions of Node:

Do you think it might be worth integrating a similar check into this library? So that a warning or something could be displayed? Or perhaps modifying the "engines" part of package.json to help avoid broken Node versions at installation time?

@ghost
Copy link

ghost commented Mar 29, 2018

Keypress doesn't work in Git Bash for me also. But it works fine with ConEmu64 (https://conemu.github.io/) on Windows 10.

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