iTerm 2 crashes when applescript tries to move between panels via keystroke
By james.a.greenl... on January 15, 2014 00:30 (imported from Google Code)
What steps will reproduce the problem?
- Execute the included applescript (or more specifically, open a panel, split it vertically, then split it horizontally, then keystroke CMD+OPT+left-arrow - this seems to work fine manually, but not in an applescript)
What is the expected output?
No crash.
What do you see instead?
A big crash.
What version of iTerm2 are you using?
1.0
What OS version are you using?
Mavericks
I rely on a bunch of applescripts to set up complex panel arrangements in iTerm for various projects. I noticed that just after upgrading yesterday, my scripts will cause iTerm to freeze when trying to move a panel's focus to the left, but only when the session has been split vertically at least once, and then horizontally at least once.
The following simplified applescript will produce a crash:
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
launch session "Panes"
set number of columns to 244
set number of rows to 73
-- focus the window
tell i term application "iTerm"
activate
end tell
delay 1
tell the current session
write text "echo 'panel one'"
end tell
delay 0.5
tell i term application "System Events" to keystroke "d" using command down
delay 0.5
tell the current session
write text "echo 'panel two'"
end tell
delay 0.5
tell i term application "System Events" to keystroke "D" using command down
delay 0.5
tell i term application "System Events" to key code 123 using {command down, option down}
delay 0.5
end tell
end tell