Oh-My-Posh는 Command Line Interface(cli)에서 prompt 부분을 customize할 수 있게 해주는 custom prompt engine이다.
- 유사한 것으로는 Oh-My-Zsh 이 있음 (사실 oh-my-zsh이 먼저고 이를 bash등에서 가능하도록 만들어준 것이 oh-my-posh임)
- 다양한 정보를 보여주는 장점이 있지만... terminal을 처음 띄울 때 시간이 상당히 늘어난다. (Windows terminal의 tab도 마찬가지...)
- 때문에 default theme를 그대로 사용하기보다 필요한 부분만으로 다시 구성하는 것을 권한다.
macOS와 같이 zsh를 기본으로 사용하는 경우는 oh-my-zsh가 보다 나은 선택임.
oh-my-posh를 power shell 에 설치하는 경우보다 cmd를 선호한다 (굳이 powershell을 업그레이드하기도 귀찮고...)
cmd에서 oh-my-posh 를 설치하는 경우 clink도 같이 설치하는 경우가 일반적이고 이 덕에 매우 높은 효율성을 가짐.
다음은 Windows에서 cmd 에 oh-my-posh를 설치하는 방법을 설명하고 있음
2025.10.11 - [utils/cmd and powershell] - Windows에서 Oh-My-Posh 설치하기
Windows에서 Oh-My-Posh 설치하기
Windows 외의 OS에서는 Oh My Zsh 를 권장. Windows에서의 설치는 winget 을 이용하길 권함:2024.09.08 - [utils] - [Utils] winget 간단 사용법 [Utils] winget 간단 사용법winget은 CLI Windows Package Manager임.SW 설치,업데이트
ds31x.tistory.com
설명
prompt에서 배터리 현황, git에서의 branch, 이전 command의 수행에서 에러 발생 여부, python 버전 및 가상환경의 이름 등등의 정보를 다채로운 색상과 아이콘으로 꾸밀 수 있음.
다음 그림을 보면 확연히 다른 prompt를 볼 수 있다.

특히, oh-my-posh의 경우 bash와 PowerShell 등의 다양한 shell과 linux, mac, windows등의 다양한 OS를 지원하며, 문서화가 매우 잘 되어 있다. (제공되는 테마도 정말 많다.)
단, 대부분의 테마에서 Nerd Font 를 사용하므로 해당 폰트를 꼭 추가해야만 prompt가 정상적으로 보인다.
참고
WSL2에서 git을 사용할 때 shared drive에서는 git 관련 정보가 prompt에서 보이지 않는 문제가 있음.
- 이를 해결하려면, Windows에도
git.exe가 있어야 하고, theme file에서 Git 설정 부분에서native_fallbackproperty를true로 설정해야한다. - WSL2에만 git이 설치된 경우, windosw의 storage들에서는 git 관련 정보가 보이지 않기 때문 활용도가 떨어진다.
- 더욱이 oh-my-posh에서는
native_fallback의 default 설정값이false이기 때문에 windows에서 git을 설치하고 이를 바꿔줘야 함.
다음과 같이 git 설정 부분에서 properties > native_fallback 을 반드시 true로 변경할 것.
{
"background": "#fffb38",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}",
"{{ if gt .Ahead 0 }}#B388FF{{ end }}",
"{{ if gt .Behind 0 }}#B388FF{{ end }}"
],
"foreground": "#193549",
"leading_diamond": "\ue0b6",
"powerline_symbol": "\ue0b0",
"properties": {
"branch_max_length": 25,
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true,
"native_fallback": true
},
"style": "powerline",
"template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"trailing_diamond": "\ue0b4",
"type": "git"
},
관련 내용 URL : https://github.com/JanDeDobbeleer/oh-my-posh/issues/2097
Git status not working in WSL · Issue #2097 · JanDeDobbeleer/oh-my-posh
Code of Conduct I agree to follow this project's Code of Conduct What happened? Hi, I was previously running version 7.9.1 and noticed that the Git segment does not render in WSL when targeting a r...
github.com
관련자료
Oh My Posh의 공식 홈페이지의 설치 문서 (linux)임.
https://ohmyposh.dev/docs/installation/linux
Linux | Oh My Posh
Set up your terminal
ohmyposh.dev
다음은 Scott Hanselman 의 YouTube임.
- PowerShell 을 이용한 설명이지만 Windows에서 Terminal 을 개선할 수 있는 방법을 확실히 알 수 있음.
- 상당히 긴 편임.
'개발환경' 카테고리의 다른 글
| [Env] PowerShell v7.3.5 (0) | 2023.06.28 |
|---|---|
| [Env] xterm: Font (0) | 2023.06.26 |
| [Env] VSCode : Terminal Font 변경: (0) | 2023.06.21 |
| [Env] Environment Variable (환경변수) (1) | 2023.06.20 |
| [Shell] env and Shebang line (0) | 2023.06.20 |