Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does xdotool type twice ? How can I avoid it?

[Wed Aug 05 20:49:43 deppfx@localhost:~] $xdotool type password

password[Wed Aug 05 20:50:51 deppfx@localhost:~] $password

How can I avoid this ? Can someone please explain this behavior ?

like image 337
deppfx Avatar asked Oct 28 '25 17:10

deppfx


2 Answers

@Wnoise is right!

But if you insist you can do this:

stty -echo && xdotool type password && stty echo
like image 124
Arash Avatar answered Oct 30 '25 07:10

Arash


Adding to the answer above, one could add tput el1 before echo such that

xdotool type password; tput el1; echo

This will erase the unnecessary contents, creating a blank line after the previous prompt (which is also unnecessary)

[Wed Aug 05 20:49:43 deppfx@localhost:~]$ xdotool type password; tput el1; echo

[Wed Aug 05 20:49:43 deppfx@localhost:~]$ password
like image 20
Anuj Falcon Avatar answered Oct 30 '25 06:10

Anuj Falcon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!