Prezto: Current prezto incompatible with new zsh v5.4.1 (macOS)

Created on 10 Aug 2017  Â·  14Comments  Â·  Source: sorin-ionescu/prezto

Description

after updating zsh to v5.4.1 via homebrew, the cat command incl. GNU-cat (maybe other unrelated commands too) displays strange behavior; the last line of a cat stdout is omitted; if the catted file contains only one line, it looks in the Terminal as if the file is empty (no stdout); if the catted file contains at least two lines, the final line is "swallowed" (missing), independent of file size (line count). After switching to the system default zsh at /bin/zsh, everything is fine again; after completely removing prezto and resetting zsh to a blank zshrc, everything is fine with v5.4.1. Then, after reinstalling prezto (fresh without any customization), the problem appears again.

Expected behavior

no missing last lines in stdout, e.g. with cat

Actual behavior

see above: description

Steps to Reproduce

  1. update zsh to 5.4.1; witness buggy behavior
  2. completely delete prezto to see default behavior
  3. install fresh prezto to see the buggy behavior again

Versions

  • Prezto commit: current
  • ZSH version: 5.4.1
  • OS information: 10.11.6

All 14 comments

Have you tried switching prompts?

Yes, switching to default zsh (as I wrote above), but also changing the shell temporarily with bash. No problems in both cases, only with zprezto in combination with newest zsh 5.4.1. Switch to Apple's Terminal app using zsh, same thing.

Edit: I believed you meant something else, but yes, I've also switched prezto prompts, sorin, agnoster. Same same. (The problem originally happened with my original paradox setup.)

This is how it looks with paradox: simple cat vs. cat into variable + echo
Using iTerm2 by the way, but as said above, the problem persists in Apple Terminal.app

snap

This is really strange... I'm also running homebrew zsh (5.4.1) and I'm not seeing this issue.

What is the output of which cat and what modules do you have enabled?

which cat is /bin/cat … I also have GNU-cat in /usr/local/bin, but gcat also produces this bug.

I haven't enabled any modules; except for switching to the paradox prompt, this is a fresh prezto installation without any modifications. (Deleted the original .zprezto directory, and all the .z* symlinks in $HOME … also did a reboot, just to be sure.)

This is the preztorc output:

cat ~/.zprezto/runcoms/zpreztorc | grep -v "^#" | grep -v "^$"
zstyle ':prezto:*:*' color 'yes'
zstyle ':prezto:load' pmodule \
  'environment' \
  'terminal' \
  'editor' \
  'history' \
  'directory' \
  'spectrum' \
  'utility' \
  'completion' \
  'prompt'
zstyle ':prezto:module:editor' key-bindings 'emacs'
zstyle ':prezto:module:prompt' theme 'paradox'

This looks like it's a bug with handling files with no newline at the end of them (I tested a file with a newline and a file without and only the latter caused this issue). I'm guessing it's a zsh regression, but it's hard to tell without looking into it more (I'll try to do that later today).

This is even easier to reproduce with this command: echo -n hello world

https://github.com/zsh-users/zsh/commit/43e55a9bcd2c90124a751f2597d2f33cb6e3c042#diff-bb10d67e7a8561b66a53a805f3c77a40R233

They started resetting the prompt_sp option on calls to the prompt function which is a bug on our end. We just need to specify sp in all of the prompt_opts arrays. Fix incoming soon.

I'll be working on patches for external prompts as well as most of those appear to run into this as well. However, it has been fixed for all prompts which we have the code for in prezto.

I'll open a new issue for the external prompts.

It works. Thank you!

newsnap

Thanks for reporting! Glad it was an easy fix. :)

Was a pleasure. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiqua picture hiqua  Â·  6Comments

kud picture kud  Â·  3Comments

jeffwidman picture jeffwidman  Â·  3Comments

gdetrez picture gdetrez  Â·  5Comments

mischaboldy picture mischaboldy  Â·  3Comments