The current version attempts to run "redraw-current-line" and "__zoxide_z_complete_helper" by 1) first replacing the keybinding to \[0n to "redraw-current-line", 2) printing \e[5n, 3) replacing the keybinding to \e[0n with "__zoxide_z_complete_helper", and 4) finally printing \e[5n. However, this does not work as expected. This ends up running "__zoxide_z_complete_helper" twice. This is because Bash/Readline processes the next inputs after the current completion finishes. Since the above steps 1-4 are performed inside the completion function, Bash/Readline starts processing the response \e[0n (even if it is immediately returned with zero time) only after the keybinding to \e[0n is replaced with "__zoxide_z_complete_helper". In the first place, Bash/Readline automatically redraws the command line after processing the keybinding with "bind -x", so one does not need to explicitly call "redraw-current-line". This patch simply removes steps 1-2, which did not perform what was expected. |
||
|---|---|---|
| .. | ||
| bash.txt | ||
| elvish.txt | ||
| fish.txt | ||
| nushell.txt | ||
| posix.txt | ||
| powershell.txt | ||
| tcsh.txt | ||
| xonsh.txt | ||
| zsh.txt | ||