Skip to content

Cannot move cursor when running a list prompt #117

Description

@digable-dissenter

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

Activity

  1. jhonatan-lopes commented on Oct 21, 2021

    @jhonatan-lopes

    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.

  2. ml170722d commented on Dec 13, 2021

    @ml170722d

    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.

  3. staticdev commented on Dec 17, 2021

    @staticdev
    Collaborator

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

  4. ml170722d commented on Dec 22, 2021

    @ml170722d

    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. 😄

  5. hggmarks commented on Jan 24, 2022

    @hggmarks

    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

  6. aendle commented on Jan 28, 2022

    @aendle

    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.

  7. JoeBrunsTR commented on Feb 1, 2022

    @JoeBrunsTR

    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

  8. razvan-cretu commented on Feb 10, 2022

    @razvan-cretu

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

  9. Natsume-197 commented on Mar 18, 2022

    @Natsume-197

    There is any fix for this?

  10. kronus-IT commented on Mar 30, 2022

    @kronus-IT

    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

  11. metrodorian commented on Apr 5, 2022

    @metrodorian

    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?

  12. Cube707 commented on Apr 6, 2022

    @Cube707
    Collaborator

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

  13. MrKevinWeiss commented on Apr 14, 2022

    @MrKevinWeiss

    Same here, would be nice to get a fix.

  14. razvan-cretu commented on Apr 15, 2022

    @razvan-cretu

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

  15. Cube707 commented on Jul 24, 2022

    @Cube707
    Collaborator

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

  16. guiperalta commented on Jul 25, 2022

    @guiperalta

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

  17. guiperalta commented on Jul 25, 2022

    @guiperalta

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

    Windows 10

  18. Cube707 commented on Aug 1, 2022

    @Cube707
    Collaborator

    @staticdev this can probably also be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions