Keywords: autocomplete, zsh, backspace, SECURECRT, xterm, Linux console
As an example:
- Input command ls
- And then press TAB to complete the test and find out that it is.
- The completion of a more than one LS. Other commands will also have the same problem, not necessarily double, may be a part of the duplicate
- You can try to press BACKSPACE Delete, the previous part of the letter can not be deleted ~ ~, and then modify the completion of the command is also easy to modify the wrong, executed and displayed on the
Exceptions:
- If only backspace garbled or unable to delete the problem, please check the coding problem, zsh function key mapping Keybind, terminal (xterm/securecrt/iterm) function key Mapping
Workaround:
- Make the following patch
- Then source ~/.ZSHRC can
Diff--git A/themes/robbyrussell.zsh-theme b/themes/robbyrussell.zsh-100644---a/themes/robbyrussell.zsh- Theme+ ++ b/themes/robbyrussell.zsh- -1,4 +1,4 @@-local ret_status= "% (?:%{$fg _bold[green] %}m<9e><9c>:%{$fg _bold[red]%}m<9e><9c>) "+local ret_status="% (?:%{$FG _bold[green]%}:%{$ fg_bold[red]%}) " PROMPT= ' ${ret_status}%{$fg [cyan]%}%c%{$reset _color%} $ (git_prompt_info) ' zsh_ Theme_git_prompt_prefix= "%{$fg _bold[blue]%}git: (%{$fg [red]%}"
Principle:
- References [links]
- Probably meaning that in this topic, the usage of% will cause zsh to not accurately calculate the length of the prefix, so output the complete command in the wrong position.
ZSH Auto Completion causes command display to repeat