Prevent duplicate instances by coordinating via a socket
This commit is contained in:
parent
abf3b4a54e
commit
66bf56fc4f
4 changed files with 91 additions and 2 deletions
|
@ -57,8 +57,9 @@ use staff_mode::StaffMode;
|
|||
use util::{channel::RELEASE_CHANNEL, paths, ResultExt, TryFutureExt};
|
||||
use workspace::{item::ItemHandle, notifications::NotifyResultExt, AppState, Workspace};
|
||||
use zed::{
|
||||
assets::Assets, build_window_options, handle_keymap_file_changes, initialize_workspace,
|
||||
languages, menus,
|
||||
assets::Assets,
|
||||
build_window_options, handle_keymap_file_changes, initialize_workspace, languages, menus,
|
||||
only_instance::{ensure_only_instance, IsOnlyInstance},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -66,6 +67,10 @@ fn main() {
|
|||
init_paths();
|
||||
init_logger();
|
||||
|
||||
if ensure_only_instance() != IsOnlyInstance::Yes {
|
||||
return;
|
||||
}
|
||||
|
||||
log::info!("========== starting zed ==========");
|
||||
let mut app = gpui::App::new(Assets).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue