diff --git a/cli.py b/cli.py index 96ecb8ecfd..2c5df6fbc4 100644 --- a/cli.py +++ b/cli.py @@ -10484,20 +10484,19 @@ class HermesCLI: self._should_exit = True event.app.exit() - @kb.add('c-S-c') # Ctrl+Shift+C - def handle_ctrl_shift_c(event): - """Copy text to clipboard (terminal-native). + try: + @kb.add('c-S-c') # Ctrl+Shift+C — no-op, let terminal handle native copy + def handle_ctrl_shift_c(event): + """No-op: let the terminal handle Ctrl+Shift+C natively. - This is a no-op at the application level. Terminal emulators - handle the actual copy operation when Ctrl+Shift+C is pressed. - This binding prevents Hermes from intercepting the keystroke - as an interrupt signal. - - On macOS the standard copy shortcut is Cmd+C (no Hermes binding - needed). On Linux/Windows Ctrl+Shift+C is the conventional - terminal copy shortcut. - """ - return # No-op — let the terminal perform native copy + Wrapped in try/except because prompt_toolkit raises ValueError + ("Invalid key: c-S-c") on platforms where this key spec is not + recognised. The binding is best-effort; if registration fails, + startup continues normally. + """ + return + except ValueError: + pass # prompt_toolkit on this platform/version doesn't support c-S-c @kb.add('c-q') # Ctrl+Q def handle_ctrl_q(event):