diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-07-07 19:06:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-07 19:06:31 +0200 |
| commit | 2b9884645dec3bea3bf69e7fba31227806d6c88f (patch) | |
| tree | cc5ba4f35d5b347f5e83d18a03cd0f54b05c07d9 /zellij-server/src/plugins | |
| parent | feat(terminal): multiline hyperlink support (#4264) (diff) | |
| download | sl0ppij-2b9884645dec3bea3bf69e7fba31227806d6c88f.tar.gz sl0ppij-2b9884645dec3bea3bf69e7fba31227806d6c88f.tar.xz sl0ppij-2b9884645dec3bea3bf69e7fba31227806d6c88f.zip | |
fix(plugins): use the terminal title when spawning terminals (#4272)
* fix(plugins): use the terminal title when spawning terminals
* docs(changelog): add PR
* fix: plugin tests
Diffstat (limited to 'zellij-server/src/plugins')
7 files changed, 27 insertions, 1 deletions
diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap index fa3cb222..e46ea1bb 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__break_panes_to_new_tab_plugin_command.snap @@ -1,6 +1,5 @@ --- source: zellij-server/src/plugins/./unit/plugin_tests.rs -assertion_line: 8246 expression: "format!(\"{:#?}\", screen_instruction)" --- Some( @@ -22,6 +21,7 @@ Some( hold_on_close: false, hold_on_start: false, originating_plugin: None, + use_terminal_title: true, }, ), ), diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap index 4df8fed1..cf0e8b03 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_background_plugin_command.snap @@ -24,6 +24,7 @@ Some( context: {}, }, ), + use_terminal_title: false, }, ), ), diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap index f78d2f04..caff93e5 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_floating_plugin_command.snap @@ -22,6 +22,7 @@ Some( context: {}, }, ), + use_terminal_title: false, }, ), ), diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap index 124456ca..d1a7fb5e 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_command_pane_plugin_command.snap @@ -22,6 +22,7 @@ Some( context: {}, }, ), + use_terminal_title: false, }, ), ), diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap index 5fc39f2d..f32a0d71 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_floating_plugin_command.snap @@ -15,6 +15,7 @@ Some( hold_on_close: false, hold_on_start: false, originating_plugin: None, + use_terminal_title: true, }, ), ), diff --git a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap index 8ba221a2..ec793a8c 100644 --- a/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap +++ b/zellij-server/src/plugins/unit/snapshots/zellij_server__plugins__plugin_tests__open_terminal_plugin_command.snap @@ -15,6 +15,7 @@ Some( hold_on_close: false, hold_on_start: false, originating_plugin: None, + use_terminal_title: true, }, ), ), diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs index ed43f091..287e86e2 100644 --- a/zellij-server/src/plugins/zellij_exports.rs +++ b/zellij-server/src/plugins/zellij_exports.rs @@ -816,6 +816,7 @@ fn open_terminal(env: &PluginEnv, cwd: PathBuf) { let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -833,6 +834,7 @@ fn open_terminal_near_plugin(env: &PluginEnv, cwd: PathBuf) { let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -857,6 +859,7 @@ fn open_terminal_floating( let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -878,6 +881,7 @@ fn open_terminal_floating_near_plugin( let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -898,6 +902,7 @@ fn open_terminal_in_place(env: &PluginEnv, cwd: PathBuf) { let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -919,6 +924,7 @@ fn open_terminal_in_place_of_plugin( let mut default_shell = env.default_shell.clone().unwrap_or_else(|| { TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() }) }); @@ -947,6 +953,7 @@ fn open_command_pane_in_place_of_plugin( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -959,6 +966,7 @@ fn open_command_pane_in_place_of_plugin( env.client_id, context, )), + use_terminal_title, }; let run_cmd = TerminalAction::RunCommand(run_command_action.into()); let _ = env @@ -984,6 +992,7 @@ fn open_command_pane( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -996,6 +1005,7 @@ fn open_command_pane( env.client_id, context, )), + use_terminal_title, }; let action = Action::NewTiledPane(direction, Some(run_command_action), name); apply_action!(action, error_msg, env); @@ -1013,6 +1023,7 @@ fn open_command_pane_near_plugin( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -1025,6 +1036,7 @@ fn open_command_pane_near_plugin( env.client_id, context, )), + use_terminal_title, }; let run_cmd = TerminalAction::RunCommand(run_command_action.into()); let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal( @@ -1050,6 +1062,7 @@ fn open_command_pane_floating( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -1062,6 +1075,7 @@ fn open_command_pane_floating( env.client_id, context, )), + use_terminal_title, }; let action = Action::NewFloatingPane(Some(run_command_action), name, floating_pane_coordinates); apply_action!(action, error_msg, env); @@ -1080,6 +1094,7 @@ fn open_command_pane_floating_near_plugin( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -1092,6 +1107,7 @@ fn open_command_pane_floating_near_plugin( env.client_id, context, )), + use_terminal_title, }; let run_cmd = TerminalAction::RunCommand(run_command_action.into()); let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal( @@ -1116,6 +1132,7 @@ fn open_command_pane_in_place( let hold_on_close = true; let hold_on_start = false; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -1128,6 +1145,7 @@ fn open_command_pane_in_place( env.client_id, context, )), + use_terminal_title, }; let action = Action::NewInPlacePane(Some(run_command_action), name); apply_action!(action, error_msg, env); @@ -1149,6 +1167,7 @@ fn open_command_pane_background( let hold_on_start = false; let start_suppressed = true; let name = None; + let use_terminal_title = false; // TODO: support this let run_command_action = RunCommandAction { command, args, @@ -1161,6 +1180,7 @@ fn open_command_pane_background( env.client_id, context, )), + use_terminal_title, }; let run_cmd = TerminalAction::RunCommand(run_command_action.into()); let _ = env.senders.send_to_pty(PtyInstruction::SpawnTerminal( @@ -2113,6 +2133,7 @@ fn break_panes_to_new_tab( let default_shell = env.default_shell.clone().or_else(|| { Some(TerminalAction::RunCommand(RunCommand { command: env.path_to_default_shell.clone(), + use_terminal_title: true, ..Default::default() })) }); |
