Skip to content

Commit 0e53645

Browse files
committed
Handle situation where iTerm is running but has no windows.
1 parent 0aecaba commit 0e53645

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
104 Bytes
Binary file not shown.

apple-scripts/iTermStable/iTerm-stable-new-tab-default.applescript

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ end scriptRun
1616
on CommandRun(withCmd, withTheme, theTitle)
1717
tell application "iTerm"
1818
if it is running then
19-
tell the current terminal
19+
set curTerm to (current terminal)
20+
try
21+
set tmp to curTerm
22+
on error
23+
set curTerm to (make new terminal)
24+
end try
25+
tell curTerm
2026
set newSession to (launch session withTheme)
2127
tell the last session
2228
reopen
@@ -41,4 +47,4 @@ on CommandRun(withCmd, withTheme, theTitle)
4147
end tell
4248
end if
4349
end tell
44-
end CommandRun
50+
end CommandRun

0 commit comments

Comments
 (0)