magmax/python-inquirer

Cannot move cursor when running a list prompt

digable-dissenter opened this issue ยท 18 comments

Similar to issue #40, but I am not trying to run in any container.

Also, similarly, I can still press return to get a value from the prompt, but since the cursor doesn't move it will always give me the first option. Any ideas?

Running on a Windows 10 machine, with Python 3.9 installed. I also assume that I am running the latest version of inquirer

I can reproduce the bug.

I am also running python 3.9 on windows 10 and cannot move the cursor. Tried on powershell and on cmd. Return key and spacebar selection work.

Running the mixed.py example, everything works well, except for the inquirer.Checkbox which only allows me to select the first option since the arrow keys do not work.

I can reproduce the bug as well.

inquirer.Checkbox and inquirer.List aren't letting me use my arrow keys to move up and down, so I'm forced to used only first option.

Other options (inquirer.Text, inquirer.Editor and inquirer.Path) are working as they should.

Could you provide a minimal example code to reproduce the error?

I was using code from examples provided in repo.

import os
import sys
from pprint import pprint

sys.path.append(os.path.realpath("."))
import inquirer  # noqa

questions = [
    inquirer.List(
        "size",
        message="What size do you need?",
        choices=["Jumbo", "Large", "Standard", "Medium", "Small", "Micro"],
    ),
    inquirer.Checkbox(
        "interests",
        message="What are you interested in?",
        choices=["Computers", "Books", "Science", "Nature", "Fantasy", "History"],
        default=["Computers", "Books"],
    )
]

answers = inquirer.prompt(questions)

pprint(answers)

I'm using IntelliJ Idea from Jet Brains. I was using terminal built into IDE and it didn't want to run as it was supposed to, but then I ran it from PowerShell and it worked. I fount this few days ago by accident.

When it was running it in terminal IDE it didn't respond to my arrow presses, but in CMD and PowerShell it did.
This is weird since terminal in IDE is supposed to use PowerShell. I don't know why this is happening. I guess it's problem with IntelliJ Ideas terminal?

If someone knows why is this is happening please let me know. ๐Ÿ˜„

Long story short: The way i've discovered was turn off numlock and use the 'numpad arrow keys'.

Something like this happened to me, when i was running it on my VSCode built-in terminal, everything worked just fine but when i ran it from my shell (CMD, or PowerShell) the cursor didn't move as well. I don't know why that's happening but in my case i turn off the numlock of my keyboard and i was able to move it pressing the numpad's '8' and '2' that alternative arrows that some keyboards have.

(Running on Windows 10 and was on my laptop's keyboard, if that means something!)

I've tested it in many ways in my computer and worked, if someone else could check this and say if it worked let me know :D

I've tested it in many ways in my computer and worked, if someone else could check this and say if it worked let me know :D

So I tested this with python 3.7 and 3.10 on windows 10 and 11.
Arrows don't work in powershell or CMD. Turing off numpad and using those keys work.
Seems like an issue with mapping the correct key input of a windows device to the inquirer.
However, if you don't have a numpad it's impossible to use.

EDIT*
clearly the issue is magmax/python-readchar#66
When pressing any arrow key in readchar.readkey() it returns nothing.

I've tested it in many ways in my computer and worked, if someone else could check this and say if it worked let me know :D

So I tested this with python 3.7 and 3.10 on windows 10 and 11. Arrows don't work in powershell or CMD. Turing off numpad and using those keys work. Seems like an issue with mapping the correct key input of a windows device to the inquirer. However, if you don't have a numpad it's impossible to use.

EDIT* clearly the issue is magmax/python-readchar#66 When pressing any arrow key in readchar.readkey() it returns nothing.

+1

I also can't move the cursor on anaconda's cmd when using the arrows.. and I don't have a numpad. (py397)

There is any fix for this?

Same problem, unable to move cursor in Windows 11, also don't have a numpad.

Is there as fix or one on the horizon?

Many thanks

Got the same Problem with Windows 11, Python 3.9 and 3.7, no Numblock on the keyboard.
I am guessing there is a Windows end-of-line-error here?

I provied the fix under magmax/python-readchar#71, but it's still waiting to be merged.

Same here, would be nice to get a fix.

@magmax Sorry to bother, could you please merge this PR magmax/python-readchar#71

readchar just released a new version that should fix this. Please confirm

@Cube707 moving cursor with keyboard arrows working on windows, thank you!

@Cube707 moving cursor with keyboard arrows working on windows, thank you!

Windows 10

@staticdev this can probably also be closed