From f50ee0c57e844c9bf652feb2ce97bf838138fb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Wed, 20 May 2026 23:28:38 +0300 Subject: [PATCH] fix: stop overriding Entry keyboard shortcuts Custom bindings blocked native Cmd+V/Backspace. Removed all keyboard overrides, kept only right-click context menu. Co-Authored-By: Claude Opus 4.6 --- ssh_manager.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/ssh_manager.py b/ssh_manager.py index 6f5b97e..3449962 100644 --- a/ssh_manager.py +++ b/ssh_manager.py @@ -492,9 +492,10 @@ def agent_search(query): def setup_entry_clipboard(entry): - """Add clipboard support (Ctrl/Cmd+C/V/X/A) and right-click menu to tk.Entry.""" + """Add right-click context menu to tk.Entry. Keyboard shortcuts (Cmd+V/C/X) + are handled by tkinter's built-in Entry bindings — do NOT override them.""" - def _paste(e=None): + def _paste(): try: text = entry.clipboard_get() if entry.selection_present(): @@ -502,24 +503,20 @@ def setup_entry_clipboard(entry): entry.insert(tk.INSERT, text) except tk.TclError: pass - return "break" - def _copy(e=None): + def _copy(): if entry.selection_present(): entry.clipboard_clear() entry.clipboard_append(entry.selection_get()) - return "break" - def _cut(e=None): + def _cut(): if entry.selection_present(): _copy() entry.delete(tk.SEL_FIRST, tk.SEL_LAST) - return "break" - def _select_all(e=None): + def _select_all(): entry.select_range(0, tk.END) entry.icursor(tk.END) - return "break" def _context_menu(event): menu = tk.Menu(entry, tearoff=0, bg="#313244", fg="#cdd6f4", @@ -531,17 +528,7 @@ def setup_entry_clipboard(entry): menu.add_command(label="Выделить всё", command=_select_all) menu.tk_popup(event.x_root, event.y_root) - # Bind all possible modifier combos for macOS and Windows - for mod in ("Command", "Control", "Meta"): - for key, func in [("v", _paste), ("V", _paste), - ("c", _copy), ("C", _copy), - ("x", _cut), ("X", _cut), - ("a", _select_all), ("A", _select_all)]: - try: - entry.bind(f"<{mod}-{key}>", func) - except tk.TclError: - pass - + # Right-click context menu only — keyboard handled by tkinter defaults entry.bind("", _context_menu) if sys.platform == "darwin": entry.bind("", _context_menu)