2

I am running Mac OS X 10.7.5. I have installed XQuartz v2.7.4, and along with it X11 v2.6.5. I have started iTerm2 with Xserver, and I believe it's working correctly since when I run xdpyinfo, the beginning of the output in xterm and in iterm2 is the same.

█ $xdpyinfo
name of display: :0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11006000
X.Org version: 1.10.6
...

However, when I run any xdotool commands in iTerm2 the output does not show up in the same window:

█ $ xdotool key f
█ - MacBook-Air:~ ()

Whereas, when I run from xterm:

bash-3.2$ xdotool key f fbash-3.2$ f

So I can tell that in xterm the output from the command is going to the right window, but that doesn't seem to be the case for iTerm2. Please let me know if you have an idea of what I may be doing incorrectly or missing. Thanks!

user1797466
  • 507
  • 6
  • 14

1 Answers1

1

The problem is that iTerm2 is not an XQuartz client, and while you are typing the commands, there is no current XQuartz window (since MacOS's focus is on the the iTerm2 window — not an XQuartz window.

The xdotool manual page tells you that the key command has an option which would be used to redirect events to other windows:

--window window
Send keystrokes to a specific window id. . You can use "WINDOW STACK" references like "%1" and "%@" here. If there is a window stack, then "%1" is the default, otherwise the current window is used.

If you gave it a valid window id using --window, it likely would work as intended.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105