Find the answer to your Linux question:
Results 1 to 6 of 6
I just tried out zsh, and I really like its style of completion where it iterates through the possibilites, however, I also like how bash displays my current directory at ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942

    zsh and bash


    I just tried out zsh, and I really like its style of completion where it iterates through the possibilites, however, I also like how bash displays my current directory at the prompt. Is there an option I can turn on in one of these shells to combine my preferences?

    Thanks!

  2. #2
    Linux Guru budman7's Avatar
    Join Date
    Oct 2004
    Location
    Knee deep in Grand Rapids, Michigan
    Posts
    3,242
    Is this what you are talking about?

    http://www.b2pi.com/zsh/FAQ/zshfaq03.html#l22
    How to know if you are a geek.
    when you respond to "get a life!" with "what's the URL?"
    - Birger

    New users read The FAQ

  3. #3
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    In every shell there is a variable that sets the way the prompt is displayed. In bash and zsh this is the PS1 variable; you usually set this with a
    Code:
    PS1 = "whatever"
    line in .zshrc. The syntax of the prompt is different in zsh than bash, and is covered in "PROMPT EXPANSION" section of "man zshmisc".

  4. $spacer_open
    $spacer_close
  5. #4
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    PS1="$PWD"$"

    And don't forget PS2, 3 and 4.

  6. #5
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    I don't think I explained it well. I'll just give an example:

    Current bash prompt:
    Code:
    rob@TheRing:~$
    Current zsh prompt:
    Code:
    TheRing%
    I'd like the zsh one to look just like the bash one.

  7. #6
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    add
    Code:
    PS1 = "%n@%m:%~$ "
    to your .zshrc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •