Open g-h-97 opened 2 weeks ago
I also want to mention that the below command works correctly but unfortunately it completely omits newlines, so it cannot be used for multiline files,
echo -n "ls" | ydotool type -f - && sleep 5
Edit: The sleep 5
is to observer ydotool
behavior and not confuse it with program exit,
Hello,
I have noticed that ydotool always adds an implicit \n at the end when reading from a file using
-f
flag. For example, let's say I have a file with the followingI would assume that ydotool will type and execute the first and second commands (cd and ls) but only type the last one (rm) and I should press the final enter to execute it. However, this is not the case and ydotool behaves as if the file is like this (with a trailing new line after the
rm
Another point worth mentioning is that passing the text I want to type via CLI does not show the same behavior, as in, new lines are types only if they're explicitly there,
Regards,