magmax/python-inquirer

Pasted path cuts off at space

JackBailey opened this issue · 3 comments

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?

@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?

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

@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 magmax/python-readchar#95 for details