Skip to main content
added 169 characters in body
Source Link
Stéphane Chazelas
  • 586.4k
  • 96
  • 1.1k
  • 1.7k

I think you want to do:

export PROMPT='[%n]%t '

PROMPT='[%n]%t ' 

setenv doesn't seem to work with Zsh version 5.0is a csh command.8 The equivalent in Bourne-like shell would be export, which is what I tried it withbut here you don't want to export that variable to the environment, just define the $PROMPT shell variable (typically in your ~/.zshrc).

Try man zshmisc and look for the section "SIMPLE PROMPT ESCAPES" (or run info zsh 'prompt expansion') to see all of the escape-sequences available. Also, take a look at zsh's RPROMPT environment variableRPROMPT variable. It can be useful and fun.

I think you want to do:

export PROMPT='[%n]%t '

setenv doesn't seem to work with Zsh version 5.0.8, which is what I tried it with.

Try man zshmisc and look for the section "SIMPLE PROMPT ESCAPES" to see all of the escape-sequences available. Also, take a look at zsh's RPROMPT environment variable. It can be useful and fun.

I think you want to do:

PROMPT='[%n]%t ' 

setenv is a csh command. The equivalent in Bourne-like shell would be export, but here you don't want to export that variable to the environment, just define the $PROMPT shell variable (typically in your ~/.zshrc).

Try man zshmisc and look for the section "SIMPLE PROMPT ESCAPES" (or run info zsh 'prompt expansion') to see all of the escape-sequences available. Also, take a look at zsh's RPROMPT variable. It can be useful and fun.

Source Link
user732
user732

I think you want to do:

export PROMPT='[%n]%t '

setenv doesn't seem to work with Zsh version 5.0.8, which is what I tried it with.

Try man zshmisc and look for the section "SIMPLE PROMPT ESCAPES" to see all of the escape-sequences available. Also, take a look at zsh's RPROMPT environment variable. It can be useful and fun.