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

Press arrow keys when handling the text input will crash on Windows platform #198

Closed
kentwelcome opened this issue Jul 22, 2022 · 1 comment · Fixed by #206
Closed

Press arrow keys when handling the text input will crash on Windows platform #198

kentwelcome opened this issue Jul 22, 2022 · 1 comment · Fixed by #206

Comments

@kentwelcome
Copy link

kentwelcome commented Jul 22, 2022

By running the example code on the Windows platform, it will crash when I press arrow keys (ex: ←, →, etc...).

import re

import inquirer
questions = [
  inquirer.Text('name', message="What's your name"),
  inquirer.Text('surname', message="What's your surname"),
  inquirer.Text('phone', message="What's your phone number",
                validate=lambda _, x: re.match('\+?\d[\d ]+\d', x),
                )
]
answers = inquirer.prompt(questions)

CleanShot 2022-07-22 at 11 38 42@2x

The crash point is this line, the variable pressed will be None on Windows platform.

Python-inquirer version: 2.9.2
Python Version: 3.9.12 64-bit
OS: Microsoft Windows [Version 10.0.17763.3165]

@Cube707
Copy link
Collaborator

Cube707 commented Jul 25, 2022

This is a issue with v3.0.5 of the readchar libary used by inquery. Should be fixed with the new version of readchar that was released yesterday. Please update readchar and test again

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

Successfully merging a pull request may close this issue.

2 participants