Skip to content

Commit

Permalink
setup/bash: trigger command completion
Browse files Browse the repository at this point in the history
  • Loading branch information
joshi4 committed May 5, 2024
1 parent 372789b commit cc588a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/setup/bash-preexec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc588a0

Please sign in to comment.