T12: sessions: new (+, Cmd-T), close (row x, Cmd-W), select (press, Cmd-1 to 8, Cmd-9 last, Ctrl-Tab, Ctrl-Shift-Tab), Ghostty's keys off macOS; rows show the title and the folder with ~; an ended program closes its row, the last row the window, and the app quits; a bell marks a hidden row; new sessions follow the Shell and Start in settings
CI / platforms (windows-latest) (push) Failing after 7s
CI / macos (push) Failing after 8m29s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-14 18:07:39 -04:00
1 parent ccbea6a7a0
commit 5fd674e82a
6 files changed
+391 -52

No files matched your search

+11 -6
View File
@@ -3,15 +3,15 @@ use std::borrow::Cow;
use anyhow::Context as _;
use ely_gpui_component::theme::ActiveTheme;
use gpui::{
App, AppContext, Bounds, Focusable, TitlebarOptions, WindowBounds, WindowDecorations,
WindowHandle, WindowOptions, px, size,
App, AppContext, Bounds, TitlebarOptions, WindowBounds, WindowDecorations, WindowHandle,
WindowOptions, px, size,
};
#[cfg(target_os = "macos")]
use crate::term::mac;
use crate::{
settings::SettingsStore,
term::{ICONS, Launch, MONO, TerminalView, config, input, shell::ShellIntegration, spawn},
term::{ICONS, Launch, MONO, config, input, shell::ShellIntegration, spawn},
themes,
workspace::{self, TITLE, Workspace},
};
@@ -41,6 +41,13 @@ pub fn start(cx: &mut App) -> anyhow::Result<()> {
ShellIntegration::init(cx)?;
input::bind_keys(cx);
workspace::bind_keys(cx);
cx.on_window_closed(|cx, _| {
if cx.windows().is_empty() {
log::info!("app: no window left; quitting");
cx.quit();
}
})
.detach();
#[cfg(target_os = "macos")]
{
mac::repeat_held_keys();
@@ -74,9 +81,7 @@ pub fn open(launch: Launch, cx: &mut App) -> anyhow::Result<WindowHandle<Workspa
window
.observe_window_appearance(|_, cx| themes::apply(cx))
.detach();
let terminal = cx.new(|cx| TerminalView::new(pty, events, window, cx));
window.focus(&terminal.focus_handle(cx), cx);
cx.new(|cx| Workspace::new(terminal, window, cx))
cx.new(|cx| Workspace::new(pty, events, launch.cwd, window, cx))
})?;
log::info!("app: main window open");
Ok(window)