Prezto: Weird tab behaviour in two line prompt themes

Created on 26 Nov 2017  路  14Comments  路  Source: sorin-ionescu/prezto

Description

When I type cd then hit Tab to view suggestions, the cursor suddenly jumps one line up. This happens in two line prompt themes only, like steeef or pure.

Screen_Shot_2017-11-26_at_12.24.04.png

Screen_Shot_2017-11-26_at_12.25.18.png

Expected behavior


Hitting Tab stays on the same line.

Steps to Reproduce

  1. [First Step]
    I have completion and autosuggestions modules enabled.
    to be precise, following is my full list of modules:
zstyle ':prezto:load' pmodule \
  'environment' \
  'terminal' \
  'editor' \
  'history' \
  'directory' \
  'spectrum' \
  'utility' \
  'completion' \
  'homebrew' \
  'osx' \
  'archive' \
  'docker' \
  'syntax-highlighting' \
  'history-substring-search' \
  'autosuggestions' \
  'prompt'
  1. [Second Step]
    enable two line prompt theme like:
    zstyle ':prezto:module:prompt' theme 'pure'
    Try to complete something with tab.

Versions

  • Prezto commit: 221c6cd
  • ZSH version: zsh 5.4.2 (x86_64-apple-darwin17.0.0)
  • OS information: macOS 10.13.1 (17B48)

PS: it never happened in prior versions of prezto.

Bug

Most helpful comment

I am using paradox and have same problem.

All 14 comments

I've tried with the following settings and haven't been able to reproduce it yet:

  • Prezto commit: 221c6cd, 65bcbae8bc2731f5e07690eb339c40c82fe9a855 (I've tried both of these - the one you mentioned and latest)
  • ZSH version: zsh 5.4.2 (x86_64-apple-darwin16.7.0)
  • OS information: macOS 10.12.6 (16G1036)

Looks like it is pure theme messing up. I've checked it out to tag v1.5.2 and everything is ok. I'll report to pure's upstream.

Cross-posting from https://github.com/sindresorhus/pure/issues/372 in case anyone over here has any ideas on how to fix this:

@vbauerster confirmed that that it's expand-or-complete-with-indicator from Prezto that causes this behavior (combined with Pure).

My theory:

The problem likely stems from the fact that Pure is a multi-line prompt (includes newlines in $PROMPT) and prezto is calling zle redisplay while completion is active. I believe this state confuses ZLE and might actually be a bug in Zsh (e.g. cursor outside editing buffer and prompt is multi-line).

Thoughts? We've had a previous encounter with this issue in https://github.com/sindresorhus/pure/issues/362. There updating Zsh from 5.3.1 to 5.4.2 fixed the issue, not sure what's triggering it this time around.

Oh, wow. Thanks for investigating.

I've added a workaround to that function in 8ed2c78d which will only trigger the additional behavior if :prezto:module:editor:info:completing:format is set which should resolve the issue.

Once someone can confirm that this is fixed, this can be closed.

I am using paradox and have same problem.

Similarly, I have been using a theme based on Paradox and this has been happening for some time. I have downgraded zsh, upgraded zsh, but the issue persists

This should be fixed in the latest version. Please update and let us know if all is well.

I'm going to close this for now, as we believe the issue should be fixed. Please comment or file a new issue if you continue to run into this issue. Thanks!

I can't spot the issue in latest version. Thanks you all, for work done!

Awesome! Glad it works! :)

Same issue using paradox on MacOS + zsh 5.5.1 (x86_64-apple-darwin17.5.0)
However the same configuration does not present the issue on Raspberry Pi + zsh 5.0.7 (arm-unknown-linux-gnueabihf)

my configuration here: https://github.com/cvigo/prezto.git

MacOS issue is solved commenting the two lines pointed here https://github.com/sindresorhus/pure/issues/362#issuecomment-340508207
... but I miss the nice ... prompt in autocompletion

I am up-to-date with master as it was this morning

Same problem here on Mac OS X+ zsh 5.3 (x86_64-apple-darwin17.0)
Zpresto commit d4332e2faf420f73ada88397bee95dc4f1da6b97

Still seems to be a problem zsh 5.7.1 macOS Mojave 10.14.6

For those who still experience this:
Edit file vi ~/.zprezto/modules/editor/init.zsh, comment out these lines https://github.com/sorin-ionescu/prezto/blob/4b0ecffacadec6c9553be894cdcd36ecafac7662/modules/editor/init.zsh#L366-L367

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mischaboldy picture mischaboldy  路  3Comments

gdetrez picture gdetrez  路  5Comments

jeffwidman picture jeffwidman  路  3Comments

lokesh-krishna picture lokesh-krishna  路  5Comments

voanhduy1512 picture voanhduy1512  路  3Comments