New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some prompts remove last line from command output #1557

Closed
ickerwx opened this Issue Mar 7, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@ickerwx
Copy link

ickerwx commented Mar 7, 2018

Description

I just noticed this again, but it has happened in the past as well: I am inside a directory and run cat on a file:

(using a fancy prompt like agnoster)$ cat file
line 1
(fancy prompt again)

Now, if I run cat again using a less fancy prompt, I get this:

(less fancy prompt like minimal)$ cat file
line 1
line 2
(less fancy prompt again)

Expected behavior

I expect to see all lines of the file.

Actual behavior

The last line is missing from the output
2018-03-07-152628_696x200_scrot
It looks like some of the prompts have trouble working with output that does not end with a newline character.

Steps to Reproduce

  1. Create a file containing multiple lines of text, make sure that the last line does not have a newline character at the end
  2. Switch to a prompt like agnoster, powerline or fade (I did not test all prompts!)
  3. run cat on the file and see that the last line is not printed

Versions

  • Prezto commit: b3c27bb
  • ZSH version: zsh 5.4.2
  • OS information: Arch Linux 4.15.5-1-ARCH
@belak

This comment has been minimized.

Copy link
Collaborator

belak commented Mar 7, 2018

I'm guessing these prompts don't specify prompt_sp.

Here's an example fixing agnoster: agnoster/agnoster-zsh-theme#46

I'll take a closer look when I'm at an actual computer and not on my phone but I'd be willing to bet this is it ;)

@ickerwx

This comment has been minimized.

Copy link

ickerwx commented Mar 9, 2018

I can confirm that the problem is gone when I apply the fix you mentioned.

@belak

This comment has been minimized.

Copy link
Collaborator

belak commented Mar 10, 2018

I'm going to close this for now as it's a duplicate of #1425 and there's a workaround. Thanks for reporting!

@belak belak closed this Mar 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment