From 5002a409f915e8fffdfc85c5f1d05d42ce97bc6b Mon Sep 17 00:00:00 2001 From: Daniel Fainberg Date: Mon, 29 Jun 2026 11:26:58 +0200 Subject: [PATCH] shell: bash readline prefix history search via XDG inputrc Add $INPUTRC pointing at ~/.config/readline/inputrc and ship that file with history-search Up/Down bindings (cursor to end), mirroring zsh's history-beginning-search-end. zsh ignores readline, so this is bash-side only. Includes /etc/inputrc to keep distro defaults. Co-Authored-By: Claude Opus 4.8 --- shell/.config/readline/inputrc | 13 +++++++++++++ shell/.config/shell/exports | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 shell/.config/readline/inputrc diff --git a/shell/.config/readline/inputrc b/shell/.config/readline/inputrc new file mode 100644 index 0000000..e8a1a18 --- /dev/null +++ b/shell/.config/readline/inputrc @@ -0,0 +1,13 @@ +# Readline config (bash line editing + any readline program: python, psql...). +# Set via $INPUTRC; see shell/exports. zsh ignores this (uses ZLE); its +# equivalent prefix-search bindings live in zsh/.zshrc. +# +# Pull in distro defaults; a custom INPUTRC otherwise replaces them entirely. +$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 diff --git a/shell/.config/shell/exports b/shell/.config/shell/exports index 00e792b..2603706 100644 --- a/shell/.config/shell/exports +++ b/shell/.config/shell/exports @@ -33,5 +33,8 @@ export PYTHON_HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/python/history" # Wget config file export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/rc" +# Readline config file (bash line editing + any readline program) +export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/readline/inputrc" + # NOTE: ZDOTDIR lives in ~/.zshenv, not here. It must be set before zsh reads # any rc file, and this file is sourced too late for that.