Commit 54099e112151

Vincent Demeester <vincent@sbr.pm>
2026-02-10 14:13:17
fix(kitty): swapped Jira hint bindings and fixed clipboard copy
Inverted keybindings so copy (more common) is Ctrl+Shift+J and open is Ctrl+Shift+Alt+J. Fixed clipboard by using built-in --type regex with --program @ for copy instead of boss API, matching working word hint.
1 parent c0d0a8b
Changed files (1)
home
common
desktop
home/common/desktop/kitty.nix
@@ -110,8 +110,9 @@
       # ============================================================================
 
       # Jira issue tracker - detect and open issues (SRVKP-123, JIRA-456, etc.)
-      map kitty_mod+j mkh --customize-processing ~/.config/kitty/jira-hints.py open
-      map kitty_mod+alt+j mkh --customize-processing ~/.config/kitty/jira-hints.py copy
+      # Note: Copy uses --program @ (clipboard), open uses custom handler
+      map kitty_mod+j mkh --type regex --regex '\b([A-Z]{2,10}-\d+)\b' --program @
+      map kitty_mod+alt+j mkh --customize-processing ~/.config/kitty/jira-hints.py
 
       # Word selection hints with multiple actions
       # Copy word to clipboard (default word hint already at kitty_mod+d)
@@ -136,12 +137,9 @@
     # Custom hint scripts
     "kitty/jira-hints.py".text = ''
       """
-      Kitty hints for Jira issue detection.
+      Kitty hints for Jira issue detection and opening in browser.
       Detects patterns like SRVKP-123, JIRA-456, etc.
-
-      Actions (via extra_cli_args):
-        - 'open': Open issue in browser on issues.redhat.com (default)
-        - 'copy': Copy issue key to clipboard
+      Opens issue on issues.redhat.com.
       """
       import re
 
@@ -161,7 +159,7 @@
 
 
       def handle_result(args, data, target_window_id, boss, extra_cli_args, *a):
-          """Perform action on selected Jira issue."""
+          """Open selected Jira issue in browser."""
           matches, groupdicts = [], []
           
           for m, g in zip(data['match'], data['groupdicts']):
@@ -169,17 +167,10 @@
                   matches.append(m)
                   groupdicts.append(g)
           
-          # Determine action from extra_cli_args
-          action = extra_cli_args[0] if extra_cli_args else 'open'
-          
           for issue_key, match_data in zip(matches, groupdicts):
-              if action == 'copy':
-                  # Copy issue key to clipboard using boss API
-                  boss.set_clipboard_string(issue_key)
-              else:
-                  # Open in browser (default)
-                  url = f'https://issues.redhat.com/browse/{issue_key}'
-                  boss.open_url(url)
+              # Construct URL and open in browser
+              url = f'https://issues.redhat.com/browse/{issue_key}'
+              boss.open_url(url)
     '';
 
     "kitty/word-hints.py".text = ''