T63: a rename's field that closes while it still holds the window's focus gives it to the shown terminal, since a window that goes inactive blurs the field yet keeps the focus there, which left the terminal deaf to keys once the window came back
This commit is contained in:
4 files changed
+8
-8
No files matched your search
@@ -120,4 +120,4 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does;
|
||||
- 2026-10-19: fallback fonts, which a user asked for after 0.1.6, since the Chinese and Latin fonts people like seldom come as one: `font_fallbacks` in the settings lists installed families, tried in order for a character Font family lacks, through gpui's `Font::fallbacks`, which CoreText's cascade list, DirectWrite's fallback builder and cosmic-text's chain each honor; the system's own fallback follows the last. On Linux gpui's cosmic-text path keeps the fallback the last character took while it covers the next, so shaping clusters stay whole: with two fallbacks, a character only the second covers carries the next one, which the first covers too, into the second; macOS and Windows choose per character. The owner chose to leave that so. Each family must load as the terminal draws it, as Font family must, so a family gpui would pass over without a word stops the start or the save, the error naming `font_fallbacks`; an empty name is refused. The field is new beside `font_family`, so a settings file from before loads as it was. Settings › Appearance lists them under Family: each an Ely `FontPicker` whose pick replaces it and a button that removes it, then Add fallback, which opens an empty picker whose pick adds one, its button closing it; a refused pick shows the saved family again, as Family's does. Each row keeps an input of its own, and a removal drops the removed row's input and takes the focus away, since Ely's combobox keeps a focused input's text, and an input kept by place would show, and on Enter save, the family removed. Each picker's id is its input's entity, not its place: Ely's combobox keeps its state by id and listens to the input it first met, so a picker keyed by place, after a removal moved the inputs, wrote another row's family into its new input at the next blur. Ligatures and the bundled Nerd Font for private-use icons stand as before; the cursor preview keeps the family alone.
|
||||
- 2026-10-19: a user found the IME's candidate box jumping on Windows after 0.1.6. gpui places it, through `ImmSetCompositionWindow` and `ImmSetCandidateWindow`, only when a composition starts, at the caret the terminal reports, the grid cursor's cell from the last frame, hidden or not. On the owner's PC, WeType under powershell.exe and under a status line redrawn every 100 ms put the box at the caret in 23 compositions out of 23, so the owner closed it unreproduced. The terminal logs each caret the input method asks for, at debug, and each move of the caret, at trace, so the next report carries where the box was told to go.
|
||||
- 2026-10-19: Ely's shirt and back hair run on below the edge she holds, which a user asked for after 0.1.6, where a hop lifted her whole figure off the window and showed a gap under her collar and hands: both continue down to 340 in the icon's units, 54 below the edge at 286, past her highest lift, a hop of 31 with a press's 0.6 of one on it, so a hop shows more of her and never the gap; at rest the part below the edge lies outside her window and does not show. The shirt moves with her body, the hair with her head, as before; the hair behind her hands fills under them as she lifts.
|
||||
- 2026-10-19: a double press on a session's row renames it, which a user asked for after 0.1.6. Ely's `ListItem::editor`, added to Ely for this, draws Ely's text field in the title's place; the row's first press selects the session, as ever, and its second opens the field, holding what the session is called, selected, with the focus. Enter keeps what it holds and gives the focus back to the shown terminal, Escape drops it the same way, and a blur keeps it, as Windows Terminal's tab rename does. A press inside the open field stays the field's: the row would select its session, which takes the focus to the terminal and ends the rename. The name, its ends trimmed, stands over the program's title in the row, the terminal's header and the window's title until renamed again, a program's later titles passing under it; an empty one gives the title back to the program. It lives as long as the session, and notifications keep the program's title. Each program title, each rename and its end are logged.
|
||||
- 2026-10-19: a double press on a session's row renames it, which a user asked for after 0.1.6. Ely's `ListItem::editor`, added to Ely for this, draws Ely's text field in the title's place; the row's first press selects the session, as ever, and its second opens the field, holding what the session is called, selected, with the focus. Enter keeps what it holds, Escape drops it, and a blur keeps it, as Windows Terminal's tab rename does; whenever the field closes while it still holds the window's focus, the shown terminal takes it, and a press that took the focus elsewhere keeps it there. A window that goes inactive blurs the field and keeps its focus there, so a field closed by that blur, focus handed to nothing, left the terminal deaf to keys once the window came back. A press inside the open field stays the field's: the row would select its session, which takes the focus to the terminal and ends the rename. The name, its ends trimmed, stands over the program's title in the row, the terminal's header and the window's title until renamed again, a program's later titles passing under it; an empty one gives the title back to the program. It lives as long as the session, and notifications keep the program's title. Each program title, each rename and its end are logged.
|
||||
+1
-1
@@ -172,7 +172,7 @@ fn editor(
|
||||
.on_key_down(move |event, window, cx| {
|
||||
if event.keystroke.key == "escape" {
|
||||
cx.stop_propagation();
|
||||
workspace.update(cx, |this, cx| this.end_rename(id, false, true, window, cx));
|
||||
workspace.update(cx, |this, cx| this.end_rename(id, false, window, cx));
|
||||
}
|
||||
})
|
||||
.child(Input::new(input).size(ControlSize::Sm))
|
||||
|
||||
@@ -26,8 +26,7 @@ impl Workspace {
|
||||
&input,
|
||||
window,
|
||||
move |this, _, event, window, cx| match event {
|
||||
InputEvent::Submit => this.end_rename(id, true, true, window, cx),
|
||||
InputEvent::Blur => this.end_rename(id, true, false, window, cx),
|
||||
InputEvent::Submit | InputEvent::Blur => this.end_rename(id, true, window, cx),
|
||||
InputEvent::Changed | InputEvent::Focus => {}
|
||||
},
|
||||
);
|
||||
@@ -37,12 +36,11 @@ impl Workspace {
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
/// Closes the field renaming the session `id` names, `keep`ing what it holds or not, the shown terminal `focused` again or not.
|
||||
/// Closes the field renaming the session `id` names, `keep`ing what it holds or not; a focus it still holds goes to the shown terminal.
|
||||
pub fn end_rename(
|
||||
&mut self,
|
||||
id: EntityId,
|
||||
keep: bool,
|
||||
focused: bool,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
@@ -58,6 +56,8 @@ impl Workspace {
|
||||
return;
|
||||
};
|
||||
let pid = session.terminal.read(cx).pid();
|
||||
// A window that goes inactive blurs the field yet keeps its focus there.
|
||||
let held = input.focus_handle(cx).is_focused(window);
|
||||
if !keep {
|
||||
log::debug!("app: session {pid} keeps its name");
|
||||
} else {
|
||||
@@ -68,7 +68,7 @@ impl Workspace {
|
||||
log::info!("app: session {pid} is named {:?}", session.name);
|
||||
}
|
||||
}
|
||||
if focused && let Some(shown) = self.sessions.get(self.active) {
|
||||
if held && let Some(shown) = self.sessions.get(self.active) {
|
||||
window.focus(&shown.terminal.focus_handle(cx), cx);
|
||||
}
|
||||
self.retitle(window);
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp
|
||||
| Colors, styles, five underlines, wide characters, combining marks | T06 | `term::frame`, `term::ink`, `term::paint` tests | Pass |
|
||||
| Box drawing, blocks and powerline shapes as geometry | T07 | `term::boxes` tests | Pass |
|
||||
| JetBrains Mono, any installed font, Nerd Font icons | T06, T17 | `tests/fonts.rs` | Pass |
|
||||
| Rename: a double press on a row's title opens a field; Enter keeps the name, Escape drops it, a blur keeps it; the name shows in the row, the header and the window's title over the program's own; an empty one gives the title back | T63 | Ely test: `ListItem::editor` draws its field in the row, above the description; on macOS `shot` over a program titled `prog`: a double press on the row opened a field holding `prog`, selected; `Build box` and Enter showed it in the row, the header and the window's title, `app: session … is named "Build box"`, and the focus came back to the terminal; the program's later title `prog2`, logged four seconds after, left the window's title `Build box`; Escape logged `keeps its name` and left `prog2`; a blur from a press on the terminal while the app was active kept `Blurred`; emptied, the field gave the title back, `takes its program's title again`; a second session's rename named that row alone | Pass |
|
||||
| Rename: a double press on a row's title opens a field; Enter keeps the name, Escape drops it, a blur keeps it; the name shows in the row, the header and the window's title over the program's own; an empty one gives the title back | T63 | Ely test: `ListItem::editor` draws its field in the row, above the description; on macOS `shot` over a program titled `prog`: a double press on the row opened a field holding `prog`, selected; `Build box` and Enter showed it in the row, the header and the window's title, `app: session … is named "Build box"`, and the focus came back to the terminal; the program's later title `prog2`, logged four seconds after, left the window's title `Build box`; Escape logged `keeps its name` and left `prog2`; a blur from a press on the terminal while the app was active kept `Blurred`; emptied, the field gave the title back, `takes its program's title again`; a second session's rename named that row alone; round 1 of T63's review found that leaving the app mid-rename closed the field while the window's focus still pointed at it, so back in the app the terminal heard no key until pressed: the terminal now takes a focus the field still holds as it closes, and after the same steps `a` reached the program at once, as it did after Enter, Escape and a blur by a press on the terminal | Pass |
|
||||
| Fallback fonts: installed families tried in order for a character the family lacks, listed under Family in Settings › Appearance | T60 | `settings` test: a file without `font_fallbacks` loads with none, named families keep their order, and an empty one is refused; on macOS with Menlo and `"font_fallbacks": ["Kaiti SC"]` the terminal drew `中文字体 終端` in Kaiti and Latin in Menlo, where without it the system drew them in PingFang; a fallback gpui cannot load, `No Such Font`, stopped the start with `font_fallbacks: the terminal cannot load "No Such Font"`, and an empty one with `font_fallbacks holds an empty family`; in Settings › Appearance, Add fallback opened an empty picker, picking Kaiti SC saved `["Kaiti SC"]` and the terminal took it at once, the row's X saved `[]`, and Apple Color Emoji, which gpui loads no font for, was refused and nothing saved; round 1 of T60's review found that removing the row whose input held the focus left the removed family in it, and Enter saved it over the next: a removal drops that row's input and the focus, so after removing Kaiti SC from `[Kaiti SC, Songti SC, PingFang SC]` with its input focused the rows showed Songti SC and PingFang SC and Enter saved nothing new; round 2 found the pickers keyed by place, so after that removal a blur wrote PingFang SC into the first row and Enter saved it twice: each picker is keyed by its input, and the same removal, a click, the app activated and deactivated, and Enter, which in the build before saved `[PingFang SC, PingFang SC]`, kept `[Songti SC, PingFang SC]`; on Linux, gpui's cosmic-text path carries a character a second fallback took into the next, as AGENTS records | Pass |
|
||||
| Cursor shapes, blink by setting and DECSCUSR, hollow unfocused | T06 | T06 review | Pass |
|
||||
| xterm keys, cursor mode, Option as Alt, kitty protocol, keypad; a shifted symbol as its own key with Shift on macOS and Windows; win32-input-mode on Windows | T08, T44 | `term::keys` tests, `kitty_reports_the_key_shift_turned_into_a_symbol` red at `CSI 123;13u` before the fix; on macOS herdr 0.9.5, its `[keys]` `previous_workspace = "cmd+shift+ctrl+["` and `next_workspace = "cmd+shift+ctrl+]"`, run by `shot` in a fresh HOME: before, ⌘⇧⌃] sent `CSI 125;13u` and herdr stayed on its workspace; after, `CSI 93:125;14u` moved it to the next and ⌘⇧⌃[, `CSI 91:123;14u`, back; `term::win32` and `term::tap` tests on Windows | Pass |
|
||||
|
||||
Reference in new issue
Block a user