Skip to content

Commit

Permalink
Add option to enter the command in the current tab (#56)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Fabien-jrt and vitorgalvao committed Sep 21, 2021
1 parent 95bc444 commit f2d99ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_iterm_script.applescript
Expand Up @@ -4,6 +4,9 @@
-- Set this property to true to always open in a new window
property open_in_new_window : false

-- Set this property to false to reuse current tab
property open_in_new_tab : true

-- Handlers
on new_window()
tell application "iTerm" to create window with default profile
Expand Down Expand Up @@ -36,8 +39,10 @@ on alfred_script(query)
if has_windows() then
if open_in_new_window then
new_window()
else
else if open_in_new_tab then
new_tab()
else
-- Reuse current tab
end if
else
-- If iTerm is not running and we tell it to create a new window, we get two
Expand Down

0 comments on commit f2d99ad

Please sign in to comment.