Skip to content

Commit f2d99ad

Browse files
Add option to enter the command in the current tab (#56)
* Add option to enter the command in the current tab * Simplify opening in new tab Co-authored-by: Vítor Galvão <info@vitorgalvao.com>
1 parent 95bc444 commit f2d99ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

custom_iterm_script.applescript

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
-- Set this property to true to always open in a new window
55
property open_in_new_window : false
66

7+
-- Set this property to false to reuse current tab
8+
property open_in_new_tab : true
9+
710
-- Handlers
811
on new_window()
912
tell application "iTerm" to create window with default profile
@@ -36,8 +39,10 @@ on alfred_script(query)
3639
if has_windows() then
3740
if open_in_new_window then
3841
new_window()
39-
else
42+
else if open_in_new_tab then
4043
new_tab()
44+
else
45+
-- Reuse current tab
4146
end if
4247
else
4348
-- If iTerm is not running and we tell it to create a new window, we get two

0 commit comments

Comments
 (0)