Shortening my prompt in Zsh

后端 未结 4 1884
青春惊慌失措
青春惊慌失措 2021-02-04 04:39

I\'m having a lot of trouble getting zsh to shorten my prompt. I\'m currently using zsh with the agnoster theme and oh-my-zsh package manager.

My prompt currently gets a

4条回答
  •  走了就别回头了
    2021-02-04 05:36

    In the Zsh themes folder you should search for this file agnoster.zsh-theme , open with an editor and change this piece of code :

    prompt_dir() {
        prompt_segment blue $CURRENT_FG ' %~ '
    }
    

    with this :

    prompt_dir() {
      prompt_segment blue $CURRENT_FG "%c"
    }
    

    This will prompt the current directory instead of the full path.

提交回复
热议问题