xc
switches to different desktop if Xcode is already open with a different project #10384
Closed
Description
Describe the bug
I just noticed that there is a plugin for this but I already have a similar script for opening Xcode projects and I use this for opening the file:
open() {
if pgrep "^Xcode$" > /dev/null; then
# If a different project is already open, this makes sure that we activate the window for the project we are opening now
command open -g "$*"
fi
command open "$*"
}
This makes sure that if a new window is opened, then it is opened in the current desktop instead of the desktop for the already open Xcode project.
Steps to reproduce
xc a.xcworkspace
# move the opened window to another desktop
xc b.workspace
# desktop will switch to the one that has the other workspace open and also open the new workspace there
Expected behavior
always open Xcode in the current desktop, except if the workspace is already open in a different desktop, then navigate there
Screenshots and recordings
No response
OS / Distro
macOS 12.0.1
Zsh version
5.8
Terminal emulator
iTerm2
If using WSL on Windows, which version of WSL
No response
Additional context
No response
Metadata
Assignees
Type
Projects
Status
Done