Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin Terminal and zsh strange characters used in username

Hi I've recently installed zsh using cygwin on my Windows machince but when I type zsh to start this I get the following:

 GG@GG-PC ~
$ zsh
\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$

On my mac I am using iTerm2 and this is so much easier to setup on here. Also I am having trouble in setting up the aliases and this is becauses its not setup properly in terms of config file where I can set this up in a separate file.

Any ideas how I can resolve?

like image 429
GSG Avatar asked Aug 11 '14 14:08

GSG


1 Answers

It looks like zsh is inheriting the value of PS1 from the previous shell. The PS1 environment variable sets the shell prompt, and zsh used a different format for prompt substitutions than other shells. Try entering the following command after you start zsh:

PS1=$'%{\e]0;%d\a%}\n%F{green}%n@%m %F{yellow}%d%f\n%# '

If that works, add that line to your ~/.zshrc file.

That's also probably a good place to put your aliases.

like image 127
Ross Ridge Avatar answered Sep 19 '22 11:09

Ross Ridge