Skip to main content

I would like to edit my shell prompt to display time. AmI am currently using zsh, though I would like the customize the shell prompt to show time.

I understand that an echo $PS1 will give me the environment variable contents. Given:

[%n]%~ 

Setting the prompt using:

setenv PROMPT '[%n]%t ' 

I also know if I type man zsh and press enterenter it will give me a list of formats I can change to.

I would like to edit my shell prompt to display time. Am currently using zsh, though I would like the customize the shell prompt to show time.

I understand an echo $PS1 will give me the environment variable contents. Given:

[%n]%~ 

Setting the prompt using:

setenv PROMPT '[%n]%t ' 

I also know if type man zsh and press enter it will give me a list of formats I can change to.

I would like to edit my shell prompt to display time. I am currently using zsh, though I would like the customize the shell prompt to show time.

I understand that an echo $PS1 will give me the environment variable contents. Given:

[%n]%~ 

Setting the prompt using:

setenv PROMPT '[%n]%t ' 

I also know if I type man zsh and press enter it will give me a list of formats I can change to.

edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k
Source Link
Juan Davila
  • 145
  • 1
  • 5
  • 15

How to edit shell prompt to show time?

I would like to edit my shell prompt to display time. Am currently using zsh, though I would like the customize the shell prompt to show time.

I understand an echo $PS1 will give me the environment variable contents. Given:

[%n]%~ 

Setting the prompt using:

setenv PROMPT '[%n]%t ' 

I also know if type man zsh and press enter it will give me a list of formats I can change to.