On the latest macOS High Sierra, iTerm2, zsh, and oh-my-zsh, I've noticed that tab completion when using a multiline prompt is no longer flushing correctly. I've verified this issue on two separate machines and I'm wondering:
- if you can also verify this is an issue for you
- how to start zeroing in on which system is causing this issue
- if you know of a workaround
Example prompt:
PROMPT="$(virtualenv_info) %n at %~ on %M $(vcs_info)
%(!.#.$) "
Which produces:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$
Issue:
When attempting tab completion for commands like ls
or cd
, hitting TAB to see subdirectories causes the subsequent print to overwrite the lines containing the prompt:
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-f...
Hit TAB
(myvirtualenv) me at ~/source/some-repo on localhost [master]
$ ls some-folder/
Hit TAB again
some-folder/
folder-1/ folder-2/ folder-3/
The above output overwrites the lines containing the prompt. I've tried setting locale info and different kinds of newlines. This multiline prompt still works correctly on an older version of zsh running on a CentOS AWS box I have, and tomorrow I can confirm whether it's still working on a < 10.13 macOS machine.