ssanthosh243 / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

xdotool type "Hello all?" does not echo Spaces #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $ xdotool type Hello all how is everything going?

What is the expected output? What do you see instead?
Expected: Hello all how is everything going?
Actual:   Helloallhowiseverythinggoing?

What version of the product are you using? On what operating system?
xdotool xdotool_2.20110530.1-1_x86_64.deb
Ubuntu 11.04
Qwerty keyboard,

Please provide any additional information below.
After updating because i was not able to type question marks now all spaces 
seem to get dropped.

Original issue reported on code.google.com by firedrag...@gmail.com on 25 Nov 2011 at 2:59

GoogleCodeExporter commented 9 years ago
You said that the following command produced unexpected output:

xdotool type Hello all how is everything going?

That output is unexpected *by you*..  You said that the expected output would 
have been "Hello all how is everything going?" but this is not the case.  This 
is not an issue with xdotool, but with your use of bash or whatever shell you 
used to type the xdotool command.  

As an illustration, consider what would happen if, instead of a space, you had 
a [Tab] [2 spaces] [Tab] in between "Hello" and "all" and "how" .. etc.?  You 
would probably expect xdotool to type the tab-space-space-tab in between, but 
the fact is, xdotool *does not know* what you typed between the words.  That 
information is not given to the xdotool progra by your shell.

See http://mywiki.wooledge.org/WordSplitting

The proper way to do it is to use quoting:  xdotool type 'Hello all how is 
everything going?'  Within the quotes, you can do tab-space-space-tab etc. and 
xdotool will faithfully reproduce it.

Original comment by kiikrafi...@gmail.com on 10 Feb 2012 at 11:33

Yokai-Seishinkage commented 8 years ago

I have the same issue however the quotes will not solve my issue. I am having xdotool type a string taken from a text file using "shuf -n 1 file.txt" and I set that command as a variable.

So:

GEN="$(shuf -n 1 file.txt)"

xdotool type $GEN

I have tried all manner of methods to force xdotool to include spaces in the strings from the text file but nothing is working. It has nothing to do with the shell, nor does it have anything to do with my ability to code. This is a bug in xdotool.

MrAwesome commented 6 years ago

I know this is a couple years old, but in case someone ends up here from google - you just need to do

xdotool type "$GEN"

For this to work as expected.