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

input.choose returns false for all options #3

Closed
ToothpickFactory opened this issue May 31, 2020 · 5 comments
Closed

input.choose returns false for all options #3

ToothpickFactory opened this issue May 31, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ToothpickFactory
Copy link

I am attempting to use the input.choose method but the result is always an array of false values. Here is what I am running

import InputLoop from "https://deno.land/x/input/index.ts";
const input = new InputLoop();
const weapon = await input.choose(["sword", "bow", "dagger"]);
console.log(weapon);

I am running this in Powershell 7 on Windows.

@keegandonley
Copy link
Owner

@ToothpickFactory Thanks is for reporting this! I haven’t tested this yet using Powershell but I’ll try to get my hands on a Windows machine and look into this tonight. My guess is the console input doesn’t come back the same way it does on MacOS.

@ToothpickFactory
Copy link
Author

No problem. Looking to see if I can figure it out. Narrowed it down to the TextDecoder() in the read method. It does return back "correctly" what was sent to it. Heck it even says that it's a string. When I try and compare a "2" to a 2 entered in via the console it reports that they do not equal. It's really bizarre.

@keegandonley keegandonley self-assigned this Jun 1, 2020
@keegandonley keegandonley added the bug Something isn't working label Jun 1, 2020
@keegandonley
Copy link
Owner

@ToothpickFactory I can reproduce this on a box running windows server on AWS. Investigating now

@keegandonley
Copy link
Owner

@ToothpickFactory Thanks for bearing with me on this one. I forgot to fully strip Windows carriage returns. You should see the correct behavior in the latest release: https://github.com/keegandonley/input-deno/releases/tag/1.0.1

@ToothpickFactory
Copy link
Author

Thanks for the speedy fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants