Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug report: complist miscalculates width of display strings containing a slash (/)

The following test causes the command line to jump and the completion
menu to visually break when the terminal is 80 columns wide. Similar
effects can be achieved for other terminal sizes by adjusting the
length of the file names. In addition, thereafter, there are
additional redraw errors in the completion menu when changing the
selection. In particular, compare how the menu is redrawn when moving
the selection horizontally vs. vertically. All of this appears to
happen only for file completions of which the display string contains
a slash (/).

$ cd $(mktemp -d); ZDOTDIR=$PWD HOME=$PWD PS1='%# ' exec zsh -f
% zmodload zsh/complist
% autoload compinit; compinit
% mkdir {1..9}foobarba
% _tst() { local -a files=( ~/* ); local -a displ=( "${(@D)files}" );
compadd -d displ -P '~/' -fW ~/ - $files[@]:t }
% compdef _tst tst
% bindkey '^I' menu-select
% tst \t\t

Messages sorted by: Reverse Date, Date, Thread, Author