From dc2d70bfe127645a11bc791123af7aa01f0a222f Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Fri, 23 Jan 2026 19:07:13 +0100 Subject: [PATCH] Fix default keybindings for Ctrl-c and Ctrl-x in command mode (#3973) Micro doesn't support chained actions for command mode keybindings yet, it only supports them for regular buffer keybindings. Whereas Ctrl-c and Ctrl-x are bound by default to the chained actions Copy|CopyLine and Cut|CutLine in both buffer mode and command mode, so in command mode Ctrl-c and Ctrl-x don't work at all (with default keybindings). Luckily CopyLine and CutLine would not be not very useful in command mode anyway. So fix the issue by changing the default keybindings in command mode to the simple non-chained actions Copy and Cut. --- internal/action/defaults_darwin.go | 4 ++-- internal/action/defaults_other.go | 4 ++-- runtime/help/keybindings.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/action/defaults_darwin.go b/internal/action/defaults_darwin.go index 74d18e83..44b4fcc1 100644 --- a/internal/action/defaults_darwin.go +++ b/internal/action/defaults_darwin.go @@ -146,8 +146,8 @@ var infodefaults = map[string]string{ "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "Copy|CopyLine", - "Ctrl-x": "Cut|CutLine", + "Ctrl-c": "Copy", + "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste", "Home": "StartOfTextToggle", diff --git a/internal/action/defaults_other.go b/internal/action/defaults_other.go index 90a535f6..10e5b083 100644 --- a/internal/action/defaults_other.go +++ b/internal/action/defaults_other.go @@ -149,8 +149,8 @@ var infodefaults = map[string]string{ "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "Copy|CopyLine", - "Ctrl-x": "Cut|CutLine", + "Ctrl-c": "Copy", + "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste", "Home": "StartOfTextToggle", diff --git a/runtime/help/keybindings.md b/runtime/help/keybindings.md index 5ed58570..50dc4057 100644 --- a/runtime/help/keybindings.md +++ b/runtime/help/keybindings.md @@ -699,8 +699,8 @@ are given below: "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "Copy|CopyLine", - "Ctrl-x": "Cut|CutLine", + "Ctrl-c": "Copy", + "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste", "Home": "StartOfTextToggle",