Text selection misses first character when clicking in middle and dragging left #10072
-
Issue DescriptionWhen selecting text by clicking on a character and dragging left (right-to-left selection), the character under the initial click is not included in the selection if the click occurs in the middle or left portion of the character. This creates an unintuitive user experience where the same click position produces different results depending on drag direction. Root CauseIn
const threshold_point: u32 = @intFromFloat(@round(
@as(f64, @floatFromInt(size.cell.width)) * 0.6,
));This creates a directionally-dependent "dead zone" that feels like an off-by-one error to users. Suggested FixChange the threshold from 60% to 50% to make selection behavior symmetric and intuitive: const threshold_point: u32 = @intFromFloat(@round(
@as(f64, @floatFromInt(size.cell.width)) * 0.5,
));This ensures clicking in the middle of a character includes it regardless of drag direction. Additional NotesTested the 50% threshold fix locally and it significantly improves the selection UX imo. Expected BehaviorWhen clicking anywhere within a character's bounds, that character should be included in the selection regardless of which direction you drag. Actual BehaviorThe character is only included if you click in the right 40% of the character cell when dragging left. Clicking in the middle (or left 60%) excludes it from the selection. Reproduction Steps
Ghostty LogsNo response Ghostty VersionOS Version InformationUbuntu 24.04 (Linux only) Display ServerWayland (Linux only) Desktop Environment/Window ManagerGNOME 46 Minimal Ghostty ConfigurationI don't know what to put here.Additional Relevant ConfigurationNo response I acknowledge that:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
what's the reason for the assymetry? 30+ years using computers and I don't remember having this problem once before. |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/ghostty-org/ghostty/blob/main/src/Surface.zig#L4831-L4854 there is a big comment explaining why its 60% this is the first complaint I've ever seen about it being asymmetrical I also don't think other terminals (from what I've used) choose 50% either. They decide that any percentage of that cell will be part of that selection
I think that is because most programs are quite different than terminals that have a large grid of cells |
Beta Was this translation helpful? Give feedback.
-
|
It's been 60% for almost 3 years and this is the first complaint. It'll take a lot more feedback for us to change this. |
Beta Was this translation helpful? Give feedback.
It's been 60% for almost 3 years and this is the first complaint. It'll take a lot more feedback for us to change this.