dialoguer icon indicating copy to clipboard operation
dialoguer copied to clipboard

In tmux session content is pasted multiple times

Open mkon opened this issue 2 years ago • 1 comments

Hello, thanks for this nice crate!

I think i found some weird side effect when using prompts in a tmux session.

I am using dialoguer to prompt for an authenticator token like this:

Input::new().with_prompt("Enter the code").interact_text().unwrap()

When i copy&paste an authenticator OTP into the prompt it is working fine when on a shel like zsh directly. However when in a tmux session it seems like it is pasted multiple times. But it is not actually the same string multiple times, it pasted the correct string only the first time, and seems to "create" 21 characters from a 6 digit OTP by repeatedly pasting the string but always leaving some new characters from the front.

For example if i paste the string 123456 it will insert 123456234563456456566. Also it is not possible to delete characters from the prompt fully.

I can reproduce this on MacOS with both default Terminal and Alacritty.

mkon avatar Apr 10 '23 21:04 mkon

Workaround: use .interact() instead of .interact_text().

alextes avatar Jun 13 '23 14:06 alextes