Macos opening ghostty with open -n command opens it in a new process #3563
-
SummaryI am using Karabiner to set some global shortcuts to launch new instances (windows) of applications I have a shortcut that executes this command open -n "/Applications/Ghostty.app" What I expect: What happens: Why raise it as a question, not a bug?docs for
But this behavior is different than other applications, I have been using this cmd with other applications like browsers and other terminals, and what happens is that it always open a new window not create a new process |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 6 replies
-
A workaround until/if this is fixed: You can run this AppleScript:
This will open Ghostty if its closed, and will create a new window if it's open |
Beta Was this translation helpful? Give feedback.
-
I'm not 100% sure about macOS, but in my experience, Firefox doesn't support opening multiple instances, which may be relevant (of course, I don't know what browser you use; Ii'm just mentioning this in case you use Firefox). |
Beta Was this translation helpful? Give feedback.
-
This is the expected behavior of I'm not sure which terminal you're talking about but Terminal.app, iTerm 2, Kitty, and Alacritty all open multiple application instances on my box. When using this sort of logic in the future you probably want to switch to the standard
rather than what you're doing as well. Not only will this find Applications not installed in |
Beta Was this translation helpful? Give feedback.
-
Also you may want to follow #2353 since I think a direct way to manage Ghostty GUI components is what you're looking for rather than for |
Beta Was this translation helpful? Give feedback.
-
For Terminal.app I have this handy function in my fish config:
That allows me to write |
Beta Was this translation helpful? Give feedback.
-
Following this discussion because I am suffering the same issue with iterm2 and skhd I used to have this config: ❯ cat .config/skhd/skhdrc
cmd - return : osascript -e 'tell application "iTerm2" to create window with default profile command ""' || open -na iTerm
cmd + shift - return : open -n -a "Google Chrome" And that osascript allows to open new windows in the same instance, instead of creating multiple iterm2 instances. |
Beta Was this translation helpful? Give feedback.
-
A new instance is the intended behavior of |
Beta Was this translation helpful? Give feedback.
A new instance is the intended behavior of
-n
as noted here: #3563 (comment) Other applications are behaving odd, not us. :) There's probably some other way to script this but otherwise will be #2353.