Use terminal titles for buttons

This commit is contained in:
Joseph Lyons 2023-03-07 15:04:12 -05:00
parent c80942ea00
commit 0a3f0c5252
3 changed files with 39 additions and 36 deletions

View file

@ -120,10 +120,11 @@ impl TerminalButton {
let local_terminal_handles = project.local_terminal_handles();
for local_terminal_handle in local_terminal_handles {
if let Some(_) = local_terminal_handle.upgrade(cx) {
// TODO: Obtain the actual terminal "name" and put it in the menu
if let Some(terminal) = local_terminal_handle.upgrade(cx) {
let title = terminal.read(cx).title();
// TODO: Replace the `NewTerminal` action with an action that instead focuses the selected terminal
menu_options.push(ContextMenuItem::item("Terminal", NewTerminal))
menu_options.push(ContextMenuItem::item(title, NewTerminal))
}
}
}