From cc588a0bd0003b32b4c73bb5533f7de70b43e3cb Mon Sep 17 00:00:00 2001 From: Shantanu Date: Fri, 3 May 2024 14:22:03 -0700 Subject: [PATCH] setup/bash: trigger command completion --- cmd/setup/bash-preexec.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/setup/bash-preexec.sh b/cmd/setup/bash-preexec.sh index 6be3bb4..3827646 100644 --- a/cmd/setup/bash-preexec.sh +++ b/cmd/setup/bash-preexec.sh @@ -100,6 +100,17 @@ savvy_cmd_pre_cmd() { fi } +# Define a function to set the command line before user input +set_command() { + echo "Setting command" + READLINE_LINE="your_command_here" + READLINE_POINT=${#READLINE_LINE} +} + +# Set up a keybinding to trigger the function +bind 'set keyseq-timeout 0' +bind -x '"\C-x\C-t":set_command' + # Avoid duplicate inclusion if [[ -n "${bash_preexec_imported:-}" || -n "${__bp_imported:-}" ]]; then preexec_functions+=(savvy_cmd_pre_exec)