zsh-users
 help / color / mirror / code / Atom feed
* Adding a new-line to the prompt.
@ 2006-07-03 17:08 Alex Polite
  2006-07-03 17:31 ` Frank Terbeck
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Polite @ 2006-07-03 17:08 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1213 bytes --]

Howdy.

This is my first day of zsh after some approx 2300 days of bash. First thing
I have to do is recreate my bash prompt which ends in a newline. Tried
inserting a newline with "\n". That didn't do the trick. Googled this for
about an hour but still couldn't solve it.

This is what I have in .zshrc sofar:

fg_green=$'%{\e[0;32m%}'
fg_blue=$'%{\e[0;34m%}'
fg_cyan=$'%{\e[0;36m%}'
fg_red=$'%{\e[0;31m%}'
fg_brown=$'%{\e[0;33m%}'
fg_purple=$'%{\e[0;35m%}'
fg_light_gray=$'%{\e[0;37m%}'
fg_dark_gray=$'%{\e[1;30m%}'
fg_light_blue=$'%{\e[1;34m%}'
fg_light_green=$'%{\e[1;32m%}'
fg_light_cyan=$'%{\e[1;36m%}'
fg_light_red=$'%{\e[1;31m%}'
fg_light_purple=$'%{\e[1;35m%}'
fg_no_colour=$'%{\e[0m%}'

fg_white=$'%{\e[1;37m%}'
fg_black=$'%{\e[0;30m%}'


lb="%{$fg_light_blue%}[%{$fg_no_colour%}"
rb="%{$fg_light_blue%}]%{$fg_no_colour%}"

red_time="%{$fg_red%}%T%{$fg_no_colour%}"
cyan_user="%{$fg_cyan%}%n%{$fg_no_colour%}"

purple_host="%{$fg_purple%}%M%{$fg_no_colour%}"

green_pwd="%{$fg_green%}%~%{$fg_no_colour%}"

PROMPT="%{$lb%}%{$red_time%}%{$rb%}%{$lb%}%{$cyan_user%}%{$rb%}%{$lb%}%{$purple_host%}%{$rb%}%{$lb%}%{$green_pwd%}%{$rb%}
"




-- 
Alex Polite
http://flosspick.org - finding the right open source

[-- Attachment #2: Type: text/html, Size: 1459 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adding a new-line to the prompt.
  2006-07-03 17:08 Adding a new-line to the prompt Alex Polite
@ 2006-07-03 17:31 ` Frank Terbeck
  2006-07-03 18:15   ` Alex Polite
  2006-07-03 18:06 ` Mikhail Gusarov
  2006-07-03 19:22 ` Nikolai Weibull
  2 siblings, 1 reply; 6+ messages in thread
From: Frank Terbeck @ 2006-07-03 17:31 UTC (permalink / raw)
  To: zsh-users

Alex Polite <notmyprivateemail@gmail.com>:
> Howdy.
> 
> This is my first day of zsh after some approx 2300 days of bash. First thing
> I have to do is recreate my bash prompt which ends in a newline. Tried
> inserting a newline with "\n". That didn't do the trick. Googled this for
> about an hour but still couldn't solve it.

Hey Alex,
try this:

PROMPT=$'line0\nline1\nline2-%~%% '

I think $'' quoting is described in zshmisc(1) /QUOTING.

Regards, Frank


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adding a new-line to the prompt.
  2006-07-03 17:08 Adding a new-line to the prompt Alex Polite
  2006-07-03 17:31 ` Frank Terbeck
@ 2006-07-03 18:06 ` Mikhail Gusarov
  2006-07-03 19:22 ` Nikolai Weibull
  2 siblings, 0 replies; 6+ messages in thread
From: Mikhail Gusarov @ 2006-07-03 18:06 UTC (permalink / raw)
  To: Alex Polite; +Cc: zsh-users


You (notmyprivateemail@gmail.com) wrote:

 AP> This is my first day of zsh after some approx 2300 days of
 AP> bash. First thing I have to do is recreate my bash prompt which
 AP> ends in a newline. Tried inserting a newline with "\n". That
 AP> didn't do the trick. Googled this for about an hour but still
 AP> couldn't solve it.

PS1='
'

in ~/.zshrc works for me.

-- 
JID: dottedmag@jabber.dottedmag.net


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adding a new-line to the prompt.
  2006-07-03 17:31 ` Frank Terbeck
@ 2006-07-03 18:15   ` Alex Polite
  2006-07-03 21:55     ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Polite @ 2006-07-03 18:15 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

On 7/3/06, Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
>
>
> PROMPT=$'line0\nline1\nline2-%~%% '
>
> I think $'' quoting is described in zshmisc(1) /QUOTING.
>

Thanks that hit the spot. Now I have this:


fg_green=$'%{\e[0;32m%}'
fg_blue=$'%{\e[0;34m%}'
fg_cyan=$'%{\e[0;36m%}'
fg_red=$'%{\e[0;31m%}'
fg_brown=$'%{\e[0;33m%}'
fg_purple=$'%{\e[0;35m%}'
fg_light_gray=$'%{\e[0;37m%}'
fg_dark_gray=$'%{\e[1;30m%}'
fg_light_blue=$'%{\e[1;34m%}'
fg_light_green=$'%{\e[1;32m%}'
fg_light_cyan=$'%{\e[1;36m%}'
fg_light_red=$'%{\e[1;31m%}'
fg_light_purple=$'%{\e[1;35m%}'
fg_no_colour=$'%{\e[0m%}'

fg_white=$'%{\e[1;37m%}'
fg_black=$'%{\e[0;30m%}'

lb="%{$fg_dark_gray%}[%{$fg_no_colour%}"
rb="$fg_dark_gray]$fg_no_colour"

red_time="$fg_red%T$fg_no_colour"
cyan_user="$fg_cyan%n$fg_no_colour"
purple_host="$fg_purple%M$fg_no_colour"
green_pwd="$fg_green~$fg_no_colour"

PROMPT="$lb$red_time$rb$lb$cyan_user$rb$lb$purple_host$rb$lb$green_pwd$rb"$'\n'

alias ls='ls --color=auto'
alias l='ls'
alias ll='ls -l'
alias lsd='ls -d'
alias lsa='ls -la'
alias la='ls -lha'
alias lh='ls -lh'
alias rm='rm -i'
alias cvs='cvs -q -z6'
alias ssh='ssh -X -C -c blowfish'
alias tat='svn up; svn ci -m"this and that"'



And it works fine.


-- 
Alex Polite
http://flosspick.org - finding the right open source

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adding a new-line to the prompt.
  2006-07-03 17:08 Adding a new-line to the prompt Alex Polite
  2006-07-03 17:31 ` Frank Terbeck
  2006-07-03 18:06 ` Mikhail Gusarov
@ 2006-07-03 19:22 ` Nikolai Weibull
  2 siblings, 0 replies; 6+ messages in thread
From: Nikolai Weibull @ 2006-07-03 19:22 UTC (permalink / raw)
  To: Alex Polite; +Cc: zsh-users

On 7/3/06, Alex Polite <notmyprivateemail@gmail.com> wrote:
> This is my first day of zsh after some approx 2300 days of bash. First thing
> I have to do is recreate my bash prompt which ends in a newline.

If you use the prompt functionality, then you should be using
$prompt_newline (see Section 25.3, "Prompt Themes", in the manual).

  nikolai


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adding a new-line to the prompt.
  2006-07-03 18:15   ` Alex Polite
@ 2006-07-03 21:55     ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2006-07-03 21:55 UTC (permalink / raw)
  To: zsh-users

On Jul 3, 11:15am, Alex Polite wrote:
}
} Thanks that hit the spot. Now I have this:
} 
} fg_dark_gray=$'%{\e[1;30m%}'
} fg_no_colour=$'%{\e[0m%}'
} 
} lb="%{$fg_dark_gray%}[%{$fg_no_colour%}"

It doesn't really hurt anything in this case, but you've got too many
%{ and %} in there.  You don't need them both within the definition of
$fg_dark_gray et al. and also around the use of same.

} rb="$fg_dark_gray]$fg_no_colour"

That's better.

In one of your earlier messages you had %{ ... %} aournd some thingd
it should not have been, where it did matter, but you seem to have got
that fixed now.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-03 21:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-03 17:08 Adding a new-line to the prompt Alex Polite
2006-07-03 17:31 ` Frank Terbeck
2006-07-03 18:15   ` Alex Polite
2006-07-03 21:55     ` Bart Schaefer
2006-07-03 18:06 ` Mikhail Gusarov
2006-07-03 19:22 ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).