보기 좋은 윈도우 개발환경 구축을 위해 PowerShell을 위한 Oh My Zsh라고 할 수 있는 Oh My Posh를 설치 하였다

설치 과정을 3단계로 따라해보자

 

 

1. Nerd Font

우선 아래 링크에서 Nerd Font를 설치한다

 

폰트는 터미널 내에서 아이콘 등을 표현하기 위해 필요하며,

설치하지 않고 진행할 경우 유니코드 대체 문자(▯)가 표기될 수 있다

 

아래 링크에 접속해보면 폰트의 종류가 상당히 많은데

필자는 powerlevel10k에서 사용하는 Meslo 폰트로 진행하였다

 

폰트 설치 후 사용하는 IDE나 코드 에디터, 윈도우 터미널 앱의 설정에 진입하여

터미널 폰트 설정을 설치한 폰트로 꼭 변경하여 주자

 

https://www.nerdfonts.com/

 

Nerd Fonts - Iconic font aggregator, glyphs/icons collection, & fonts patcher

Iconic font aggregator, collection, & patcher: 3,600+ glyph/icons, 40+ patched fonts: Hack, Source Code Pro, more. Popular glyph collections: Font Awesome, Octicons, Material Design Icons, and more

www.nerdfonts.com

 

 

 

2. Oh My Posh

winget install JanDeDobbeleer.OhMyPosh -s winget

터미널에 위 코드를 입력하여 Oh My Posh를 설치한다

 

코드를 실행하면 Oh My Posh와 기본 테마가 함께 설치 된다

 

 

 

3. 테마

notepad $PROFILE

터미널에 위 코드를 입력하여 PowerShell 프로필 파일을 연다

 

만약 VSCode가 설치되어 있다면 notepad 대신 code 명령어를 사용해도 좋다

 

 

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\원하는테마이름.omp.json" | Invoke-Expression

프로필 파일 끝에 위 코드를 추가하여 테마를 설정하면 모든 설치가 완료된다

 

단, 파워쉘 스크립트를 실행하기 위한 권한 설정이 필요할 수 있는데

 

해당 코드 적용 이후에 에러메시지가 나타난다면

 

Set-ExecutionPolicy RemoteSigned

파워쉘에서 위 코드를 입력하여 권한을 부여하도록 하자

 

자세한 권한에 대해서는 아래 공식문서를 참고하자

 

https://learn.microsoft.com/ko-kr/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.3

 

 

 

 

 

테마 목록은 아래 링크에서 확인하여 원하는 테마를 선택할 수 있다

 

https://ohmyposh.dev/docs/themes

 

Themes | Oh My Posh

Oh My Posh comes with many themes included out-of-the-box. Below are some screenshots of the more common themes.

ohmyposh.dev

 

+ Recent posts