From 61de00137c08c00146385ef35022878c65b65950 Mon Sep 17 00:00:00 2001 From: Daniel Fainberg Date: Mon, 29 Jun 2026 12:10:51 +0200 Subject: [PATCH] shell: jump cursor to line end on bash history search history-search-* leaves the cursor at the prefix boundary, not the end, unlike zsh's history-search-end widget. Bind the search functions to throwaway keys and map the arrows to a macro that runs the search then end-of-line, so prefix recall lands the cursor at EOL like zsh. Co-Authored-By: Claude Opus 4.8 --- shell/.config/readline/inputrc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/shell/.config/readline/inputrc b/shell/.config/readline/inputrc index e8a1a18..b16ee82 100644 --- a/shell/.config/readline/inputrc +++ b/shell/.config/readline/inputrc @@ -6,8 +6,15 @@ $include /etc/inputrc # zsh-style prefix history search: type a prefix, Up/Down walk matching -# history entries with cursor at end of line. Empty prefix = previous/next. -"\e[A": history-search-backward -"\e[B": history-search-forward -"\eOA": history-search-backward -"\eOB": history-search-forward +# history entries with cursor at END of line. Empty prefix = previous/next. +# +# Readline's history-search-* leaves the cursor at the prefix boundary, not the +# end (that's why zsh needs its history-search-end widget). There's no built-in +# "search then go to end", so: bind the real functions to throwaway keys, then +# bind the arrows to a MACRO that runs the search and then end-of-line (\C-e). +"\C-x\C-p": history-search-backward +"\C-x\C-n": history-search-forward +"\e[A": "\C-x\C-p\C-e" +"\e[B": "\C-x\C-n\C-e" +"\eOA": "\C-x\C-p\C-e" +"\eOB": "\C-x\C-n\C-e"