0

I've just installed Zsh and written my own custom prompt. I also use emacs formatting in ~/.zshrc which says bindkey -e. Now when I open the shell, for some reason, it acts very weird.

For example if I just type cd Do + Tab I get this:

enter image description here

Another example, I am in ~/Downloads/Guns N' Roses - 1988 - G N' R Lies directory and I write pwd. After I type letter w everything disappears and cursor goes to beginning of next line. End result I get working directory, but it looks like this (keep in mind I typed pwd):

enter image description here

This does not happen when I am in a shorter directory like home.

What is going on here? Is it because of my PROMPT, or is it just how emacs typing works?

This is my prompt code in ~/zshrc

PROMPT="%{$fg[red]%}%n%{$reset_color%}@%
{$fg[blue]%}%m$fg[black]|$fg[green]%* %{$fg[yellow]%}%1~ %{$reset_color%}% "
2

1 Answer 1

1

Problem was color tags were not inside %{...%}. Correct sequence is now:

PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m%{$fg[black]%}|%{$fg[green]%}%* %{$fg[yellow]%}%1~ %{$reset_color%}% "

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .