ZSH Auto Completion causes command display to repeat

Source: Internet
Author: User

Keywords: autocomplete, zsh, backspace, SECURECRT, xterm, Linux console

As an example:

    1. Input command ls

    2. And then press TAB to complete the test and find out that it is.

    3. 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
    4. 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:

    1. 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:

    1. Make the following patch
    2. 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:

    1. References [links]
    2. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.