Skip to content

Commit

Permalink
fix(xcode): open Xcode in current Desk if already open in another (oh…
Browse files Browse the repository at this point in the history
mcornella committed Oct 11, 2023
1 parent da3b8fc commit fedef5d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/xcode/xcode.plugin.zsh
Original file line number Diff line number Diff line change
@@ -17,6 +17,13 @@ function xc {
local active_path
active_path=${"$(xcode-select -p)"%%/Contents/Developer*}
echo "Found ${xcode_files[1]}. Opening with ${active_path}"

# If Xcode is already opened in another Desk, we need this double call
# with -g to open the project window in the current Desk and focus it.
# See https://github.com/ohmyzsh/ohmyzsh/issues/10384
if command pgrep -q "^Xcode"; then
open -g -a "$active_path" "${xcode_files[1]}"
fi
open -a "$active_path" "${xcode_files[1]}"
}

0 comments on commit fedef5d

Please sign in to comment.