dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.61k stars 65 forks source link

[BUG] powerline-shell prompt eats stdout #68

Open NightMachinery opened 6 years ago

NightMachinery commented 6 years ago

As you see, the prompt is eating a line from stdout: image

upper -u | cat

My .powerline-shell.json:

{
  "segments": [
    "time",
    "username",
    "ssh",
    "cwd",
    "git",
    "hg",
    "jobs",
    "exit_code",
    "read_only",
    "newline",
    "root"
  ],
  "theme": "~/anaconda/lib/python3.6/site-packages/powerline_shell/themes/solarized_light.py"
}
dundalek commented 6 years ago

What is this upper command?

NightMachinery commented 6 years ago

It's just the example from the docs, converts a string to uppercase. I can see that it works before the new prompt shows itself.

On Thu, Mar 29, 2018 at 5:42 PM, Jakub Dundalek notifications@github.com wrote:

What is this upper command?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dundalek/closh/issues/68#issuecomment-377230696, or mute the thread https://github.com/notifications/unsubscribe-auth/Aii--rUtYOeVoQmsRmxqESELu_zdMuCaks5tjN3XgaJpZM4S_Vc2 .

NightMachinery commented 6 years ago

@dundalek


(defcmd upper clojure.string/upper-case) 
dundalek commented 6 years ago

I see, it is indeed a bug. However, it is not caused by powerline, it is just a bug in the pipeline implementation. I will look into it when I have some more time.

dundalek commented 6 years ago

After some digging it really seems to be caused by a combination of readline+powerline. If the last line of the output does not end with newline, the prompt gets placed on the same line, therefore "eating" the line. The simplest case to reproduce is echo -n x. The bug does not happen with the default plain prompt.