summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Hashimoto <m@mitchellh.com>2025-10-10 09:04:22 -0700
committerGitHub <noreply@github.com>2025-10-10 09:04:22 -0700
commitcbbcf06e6eaa0b1b8d1b53c7e2adb837b8be4a6f (patch)
tree429989264760e6ce4af660c523bbab4839ef3495
parent989acacbf9654586a96a958f3843b089e1d0b94c (diff)
parente70ae28fa34523bd3a14c634da08d21a0975ec1f (diff)
terminal: add semi-colon character to word boundary list for easier selection (#9069)
Sorry, I'm living dangerously here and haven't started a discussion. New ghostty user. When working interactively with SQL clients you're often writing semi-colons at the end of statements, e.g. `select * from table;` It's super annoying when you double-click to select the word `table` it actually selects `table;` Anecdotally, this behaviour disagrees with other terminals I've tried (tho not exhaustive). Disclosure: Claude wrote this code but, ironically, I "assisted it" by pointing to the file and function after uncovering issue #30 and relevant PR.
-rw-r--r--src/terminal/Screen.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig
index a98407af7..228b87922 100644
--- a/src/terminal/Screen.zig
+++ b/src/terminal/Screen.zig
@@ -2565,6 +2565,7 @@ pub fn selectWord(self: *Screen, pin: Pin) ?Selection {
'`',
'|',
':',
+ ';',
',',
'(',
')',
@@ -7819,6 +7820,7 @@ test "Screen: selectWord with character boundary" {
" `abc` \n123",
" |abc| \n123",
" :abc: \n123",
+ " ;abc; \n123",
" ,abc, \n123",
" (abc( \n123",
" )abc) \n123",