ZSH 프롬프트 가상환경 보이게 설정

2025. 3. 5. 22:19·Setting/Ubuntu

 

 

 

 

`~/.zshrc` 에 추가

 

zsh_virtualenv_prompt() {
    # If not in a virtualenv, print nothing
    [[ "$VIRTUAL_ENV" == "" ]] && return

    # Distinguish between the shell where the virtualenv was activated
    # and its children
    local venv_name="${VIRTUAL_ENV##*/}"
    if typeset -f deactivate >/dev/null; then
        echo "[%F{green}${venv_name}%f] "
    else
        echo "<%F{green}${venv_name}%f> "
    fi
}

setopt PROMPT_SUBST PROMPT_PERCENT

# Display a "we are in a virtualenv" indicator that works in child shells too
VIRTUAL_ENV_DISABLE_PROMPT=1
RPS1='$(zsh_virtualenv_prompt)'

 

 

https://virtualenvwrapper.readthedocs.io/en/latest/tips.html

 

 

 

 

 

 

 

 

 

'Setting > Ubuntu' 카테고리의 다른 글

터미널 에뮬레이터 비교 (Ghostty, WezTerm, Kitty, Alacritty, Foot, Warp)  (2) 2025.03.05
멀티 부팅 환경에서 시간 동기화 문제 해결  (0) 2025.03.05
Zsh + Prezto + Nerd Font 설정  (0) 2025.03.05
우분투 저장소 (repository) kakao mirror로 변경하기  (0) 2025.03.05
Grub 부팅 순서 설정 및 멀티 부팅 선택 (부제: 우분투에서 윈도우로 재부팅하기)  (0) 2025.03.04
'Setting/Ubuntu' 카테고리의 다른 글
  • 터미널 에뮬레이터 비교 (Ghostty, WezTerm, Kitty, Alacritty, Foot, Warp)
  • 멀티 부팅 환경에서 시간 동기화 문제 해결
  • Zsh + Prezto + Nerd Font 설정
  • 우분투 저장소 (repository) kakao mirror로 변경하기
Z0e
Z0e
3D Vision Engineer, Zoe 입니다.
  • Z0e
    I'm not a robot
    Z0e
    • 분류 전체보기
      • Spatial AI
        • Geometry
        • SLAM
      • Programming
        • Python
        • Git
        • Docker
      • Setting
        • Ubuntu
        • ROS
      • Study
        • Google Skills
  • 인기 글

  • hELLO· Designed By정상우.v4.10.3
Z0e
ZSH 프롬프트 가상환경 보이게 설정
상단으로

티스토리툴바