From abe656f51a32da800dba82ec0d7bb9f89553a1ae Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Tue, 11 Jun 2019 08:40:30 -0700 Subject: [PATCH] when attaching, don't spawn a new window unless nothing attached --- src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index c1e0972e3..083a00c8c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -147,11 +147,13 @@ fn run_terminal_gui(config: Arc, opts: &StartCommand) -> Result< domain.attach()?; - let window_id = mux.new_empty_window(); - let tab = mux - .default_domain() - .spawn(PtySize::default(), cmd, window_id)?; - gui.spawn_new_window(mux.config(), &fontconfig, &tab, window_id)?; + if mux.is_empty() { + let window_id = mux.new_empty_window(); + let tab = mux + .default_domain() + .spawn(PtySize::default(), cmd, window_id)?; + gui.spawn_new_window(mux.config(), &fontconfig, &tab, window_id)?; + } gui.run_forever() }