fix(host-linux): make ctrl+w close the active tab, not the pane#101
Open
tnfssc wants to merge 2 commits into
Open
fix(host-linux): make ctrl+w close the active tab, not the pane#101tnfssc wants to merge 2 commits into
tnfssc wants to merge 2 commits into
Conversation
GLArea::allocation() returns CSS/logical pixels, but ghostty_surface_set_size expects physical device pixels. On HiDPI screens this caused the terminal to render at a fraction of the GL viewport or with a zero-size grid. Changes: - Introduce gl_area_device_size() helper to convert logical allocation to device pixels (allocation * scale_factor). - Use explicit device_width/device_height parameter names in refresh_surface_display and add rustdoc to prevent accidental logical-pixel usage. - Add connect_scale_factor_notify handler with a last-device-size cache to avoid redundant refresh/render cycles when the notify fires without an actual size change.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adjusts how the focused terminal “close” action behaves (closing the active tab instead of removing the entire pane), and improves Ghostty surface sizing by consistently using device-pixel dimensions under GTK scaling.
Changes:
- Update
close_focused_tabto close the active tab in the focused pane. - Add pane helpers to query the active tab and close a specific tab while respecting pinned tabs.
- Convert GLArea logical allocation sizes to device pixels and refresh Ghostty surfaces on scale-factor changes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rust/limux-host-linux/src/window.rs | Changes close behavior from pane removal to active-tab closure. |
| rust/limux-host-linux/src/terminal.rs | Uses device-pixel sizing for Ghostty and refreshes on scale-factor changes. |
| rust/limux-host-linux/src/pane.rs | Adds helper APIs for active tab lookup and tab closing within a pane. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The CloseFocusedPane shortcut (bound to Ctrl+w by default) was implemented as close_focused_tab(), but it actually called remove_pane() which removed the entire pane instead of the active tab within it. Changes: - Add active_tab_in_pane() and close_tab_in_pane() helpers in pane.rs so the window layer can query and close the active tab directly. - Rewrite close_focused_tab() to close the active tab in the focused pane via the new helpers. When the last tab is closed, the pane already invokes its on_empty callback (which removes the pane), so no extra logic is needed. - Remove the now-unused remove_pane() wrapper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
CloseFocusedPaneshortcut (bound to Ctrl+w by default) was implemented asclose_focused_tab(), but it actually calledremove_pane()which removed the entire pane instead of the active tab within it.Changes:
active_tab_in_pane()andclose_tab_in_pane()helpers inpane.rsso the window layer can query and close the active tab directly.close_focused_tab()to close the active tab in the focused pane via the new helpers. When the last tab is closed, the pane already invokes itson_emptycallback (which removes the pane), so no extra logic is needed.remove_pane()wrapper.Depends on #95.