mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
mux: use tab size when spawning a new tab
Rather than using the configured initial window size, use the size of the current tab to size the newly spawned tab. refs: https://github.com/wez/wezterm/issues/920
This commit is contained in:
parent
10812c936d
commit
3ec6041b0f
@ -749,7 +749,7 @@ async fn domain_spawn_v2(spawn: SpawnV2, sender: PduSender) -> anyhow::Result<Pd
|
||||
let window_builder;
|
||||
let term_config;
|
||||
|
||||
let window_id = if let Some(window_id) = spawn.window_id {
|
||||
let (window_id, size) = if let Some(window_id) = spawn.window_id {
|
||||
let window = mux
|
||||
.get_window_mut(window_id)
|
||||
.ok_or_else(|| anyhow!("window_id {} not found on this server", window_id))?;
|
||||
@ -761,15 +761,17 @@ async fn domain_spawn_v2(spawn: SpawnV2, sender: PduSender) -> anyhow::Result<Pd
|
||||
.ok_or_else(|| anyhow!("active tab in window {} has no panes", window_id))?;
|
||||
term_config = pane.get_config();
|
||||
|
||||
window_id
|
||||
let size = tab.get_size();
|
||||
|
||||
(window_id, size)
|
||||
} else {
|
||||
term_config = None;
|
||||
window_builder = mux.new_empty_window();
|
||||
*window_builder
|
||||
(*window_builder, spawn.size)
|
||||
};
|
||||
|
||||
let tab = domain
|
||||
.spawn(spawn.size, spawn.command, spawn.command_dir, window_id)
|
||||
.spawn(size, spawn.command, spawn.command_dir, window_id)
|
||||
.await?;
|
||||
|
||||
let pane = tab
|
||||
|
Loading…
Reference in New Issue
Block a user