magmax / python-inquirer

A collection of common interactive command line user interfaces, based on Inquirer.js (https://github.com/SBoudrias/Inquirer.js/)
MIT License
1.01k stars 97 forks source link

Pasted path cuts off at space #352

Open JackBailey opened 1 year ago

JackBailey commented 1 year ago

Which operating system and Python version are you using?

macOS 11.7.2 Python 3.11.1

Which version of this project are you using?

3.1.2

What did you do?

inquirer.Path(
    "inputFile",
    message="What csv file would you like to import?",
)

Pasted in: /Users/example/Downloads/Example Folder/File With Spaces.txt

What did you expect to see?

[?] What csv file would you like to import?: /Users/example/Downloads/Example Folder/File With Spaces.txt

What did you see instead?

[?] What csv file would you like to import?: /Users/example/Downloads/Example Folder/File With

Any workaround or setting I'm missing?

Cube707 commented 1 year ago

@JackBailey

I can't reproduce this on Windows. Are you sure this isn't a issue with how your terminal passes along input or how MacOS pastes from the clipboard?

gaidzla commented 1 year ago

I have the same issue using ubuntu. My str from clipboard is cut of after a certain characters.

I tried it with the standard input function from python, everything works like expected.

inquirer.text("clipboard")
input("clipboard")

# Clipboard
https://github.com/magmax/python-inquirer/issues/352

# Output
[?] clipboard: https://github.com/magmax/python-inquirer/issues/3
clipboardhttps://github.com/magmax/python-inquirer/issues/352
Cube707 commented 1 year ago

@gaidzla This is sadly a current limitation. Pasting text has issues at the moment. They stems from how readchar (the underlaying libary) can currently not handle fast inputs, only "slow" input typed by a human. See https://github.com/magmax/python-readchar/issues/95 for details