effect icon indicating copy to clipboard operation
effect copied to clipboard

Copy-pasting in Prompt field only writes one character

Open wewelll opened this issue 1 year ago • 8 comments

When I paste some text in a prompt field, it only writes the first character

wewelll avatar Dec 08 '23 11:12 wewelll

@wewelll thanks for filing an issue!

The limitation is due to the way that prompt currently works. It reads every keypress event and re-renders the terminal accordingly.

I did just add a readLine method to the Terminal service exported by @effect/platform to address this very concern. But I'll have to look in more detail at how to handle this in prompts as they're not currently designed to support the clipboard.

IMax153 avatar Dec 08 '23 12:12 IMax153

Just echoing that this fix would be helpful as the main reason I reached for Prompt.text was to accept complicated strings (e.g. long IDs) that would be impractical to type by hand. I imagine this would also impact Prompt.password and passwords are something I almost never type by hand.

Terminal.readLine looks like a good solution in the meantime.

mattrossman avatar Jul 24 '24 21:07 mattrossman