๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

OS/Windows

PowerShell ํ…Œ๋งˆ๋กœ ์˜ˆ์˜๊ฒŒ ์“ฐ๊ธฐ ( with. Windows Terminal )

 

๋“ค์–ด๊ฐ€๊ธฐ ์ „์—

์•„๋ฌด๋ฆฌ ํ…Œ๋งˆ๋ฅผ ์ž…ํžˆ๋”๋ผ๋„ PowerShell ์ž์ฒด๋Š” ์ •๋ง ๋ชป ์ƒ๊ฒผ๋‹ค..

์•„๋ž˜ ์ฐฝ์ด ๋ญ”๊ฐ€ ํ…Œ๋งˆ๊ฐ€ ์ ์šฉ๋˜๊ธด ๋œ ๋ชจ์Šต์ด๋‹ค...

 

 

์ด ์นœ๊ตฌ๋ฅผ ์˜ˆ์˜๊ฒŒ ์“ฐ๊ธฐ ์œ„ํ•ด์„œ๋Š” Windows Terminal์ด ํ•„์š”ํ•˜๋‹ค!

zsh์ด๋‚˜ ์šฐ๋ถ„ํˆฌ ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•  ์ƒ๊ฐ์ด ์—†๋‹ค๋ฉด WSL์€ ์„ค์น˜ํ•˜์ง€ ์•Š์•„๋„ ๋˜๋‹ˆ Windows New Terminal ์„ค์น˜ ๋ถ€๋ถ„๋งŒ ํ™•์ธํ•˜์ž!

๐Ÿ‘‰๐Ÿป 2021.03.11 - [OS/Windows] - WSL, Windows New Terminal ์„ค์น˜, ์„ค์ • ๋ฐ Ubuntu ๋””๋ ‰ํ† ๋ฆฌ ์ ‘๊ทผ( at. Windows )

 

ps. ์„ค์น˜ํ•œ Windows Terminal์˜ ์ปฌ๋Ÿฌํ…Œ๋งˆ ๋ณ€๊ฒฝ

๐Ÿ‘‰๐Ÿป 2021.03.11 - [OS/Windows] - Windows Terminal ์ปฌ๋Ÿฌ ํ…Œ๋งˆ ์„ค์ • ( at. Windows )

 

Windows Terminal์ด ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋Š” ์ „์ œํ•˜์— ๋‹ค์Œ์„ ๋”ฐ๋ผ์˜ค๊ธฐ๋ฐ”๋ž€๋‹ค!

 

 

์‹œ์ž‘ํ•ด๋ณด์ž

โญ ์„ค์น˜ ๊ณผ์ •์€ powershell์„ ๊ด€๋ฆฌ์ž ๋ชจ๋“œ๋กœ ์—ด์–ด์„œ ๋”ฐ๋ผํ•˜์„ธ์š”! 

 

 

1. ์„ค์น˜ํ•œ๋‹ค.

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

Posh-Git adds Git status information to your prompt as well as tab-completion for Git commands, parameters, remotes, and branch names. Oh-My-Posh provides theme capabilities for your PowerShell prompt.

 

on-my-posh (version 03 Document page)๊ฐ€ ๋ฐ”๋กœ powershell์— ํ…Œ๋งˆ๋ฅผ ์ž…ํ˜€์ฃผ๋Š” ์นœ๊ตฌ๋‹ค.

posh-git์€ git ๋ช…๋ น, ๋งค๊ฐœ ๋ณ€์ˆ˜, ์›๊ฒฉ ํ•ญ๋ชฉ ๋ฐ ๋ถ„๊ธฐ ์ด๋ฆ„ ๋“ฑ git ์ƒํƒœ์ •๋ณด๋ฅผ ํ•œ๋ˆˆ์— ๋ณด๊ธฐ ์œ„ํ•œ ์•„์ด์ธ๋ฐ git์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์„ ๊ฑฐ๋ผ๋ฉด ๊ตณ์ด posh-git์€ ์„ค์น˜ํ•˜์ง€ ์•Š์•„๋„ ๋œ๋‹ค.

์ค‘๊ฐ„์— ์„ค์น˜ํ•  ๊ฑฐ๋ƒ๊ณ  ๋ฌผ์–ด๋ณด๋Š”๋ฐ ๋‘˜๋‹ค y ๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ์„ค์น˜ํ•˜๊ฒ ๋‹ค๊ณ  ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

 

 Tip
You may need to install NuGet if you don't already have it. Your PowerShell command line will ask if you want to install NuGet if this is the case. Select [Y] Yes. You may also need to approve that you are installing modules from PSGallery, an 'untrusted repository'. Select [Y] Yes.

๋งŒ์•ฝ NuGet์ด ์—†๋Š” ๊ฒฝ์šฐ ์„ค์น˜ํ•ด๊ธฐ ์œ„ํ•ด์„œ ์‹ ๋ขฐ ํ•  ์ˆ˜ ์—†๋Š” ์ €์žฅ์†Œ PSGallery์˜ ๋ชจ๋“ˆ์„ ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์„ ๋™์˜ํ•ด๋‹ฌ๋ผ๊ณ  ํ•  ๊ฒƒ ์ด๋‹ค. yes ์—ฌ์•ผ ์„ค์น˜ ํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ y ๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ์ง„ํ–‰ํ•˜์ž.

 

2. ์„ค์ •ํ•œ๋‹ค.

notepad $PROFILE

์œ„ ๋ช…๋ น์–ด๋กœ profile์„ ์—ด๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฒฝ๊ณ ์ฐฝ์ด ๋œจ๋Š”๋ฐ '์˜ˆ' ์„ ํƒํ•˜๊ณ  ์•„๋ž˜ ๋‚ด์šฉ์„ ์ž…๋ ฅํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

 

 

Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme jandedobbeleer

์ €์žฅ ํ›„ powershell์„ ๋„๊ณ , ์ƒˆ๋กœ์šด powershell์„ ๊ด€๋ฆฌ์ž ๋ชจ๋“œ๋กœ ์—ด์–ด์ค€๋‹ค.

 

๋Œ€๋ถ€๋ถ„ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ์ƒ๊ธธ ๊ฒƒ์ธ๋ฐ

 

์ด ์‹œ์Šคํ…œ์—์„œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์—†์œผ๋ฏ€๋กœ ~\Documents\WindowsPower
Shell\Microsoft.PowerShell_profile.ps1 ํŒŒ์ผ์„ ๋กœ๋“œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

. . .

 + CategoryInfo          : ๋ณด์•ˆ ์˜ค๋ฅ˜: (:) [], PSSecurityException
 + FullyQualifiedErrorId : UnauthorizedAccess

 

๋‹นํ™ฉํ•˜์ง€ ๋ง๊ณ  ๋‹ค์Œ ๋ช…๋ น์–ด๋กœ ํ•ด๊ฒฐํ•˜์ž.

Set-ExecutionPolicy RemoteSigned

๊ทœ์น™ ๋ณ€๊ฒฝํ•˜๊ฒ ๋ƒ๊ณ  ๋ฌผ์–ด๋ณด๋ฉด ๋‹น์—ฐํžˆ y ๋ฅผ ๋ˆŒ๋Ÿฌ ์ง„ํ–‰ํ•œ๋‹ค.

 

 

๋! ํ™•์ธํ•ด๋ณด์ž ๋‚ด ์˜ˆ์œ ํ„ฐ๋ฏธ๋„์„!

Windows Terminal ์ ‘์†

jandedobbeleer ํ…Œ๋งˆ๊ฐ€ ์ ์šฉ ๋œ ๋ชจ์Šต!

 

 

๋‹ค๋ฅธ ์—ฌ๋Ÿฌ ํ…Œ๋งˆ๋“ค์€ ์š”๊ธฐ์„œ ํ™•์ธ ๐Ÿ‘‰๐Ÿป oh my Posh: Themes

ํ•˜๊ฑฐ๋‚˜! ๋ช…๋ น์–ด๋กœ ์ง์ ‘ ํ„ฐ๋ฏธ๋„์—์„œ ๋ฐ”๋กœ ๋ณผ ์ˆ˜๋„ ์žˆ๋‹ค!

Get-PoshThemes

 

ํ…Œ๋งˆ ์ด๋ฆ„๊ณผ ์ ์šฉ ๋ชจ์Šต์ด ์ˆœ์„œ๋Œ€๋กœ ๋‚˜์˜จ๋‹ค!์—ฌ๊ธฐ์„œ ์˜ˆ์˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š” ํ…Œ๋งˆ์˜ ์ด๋ฆ„์„ .omp ๋ฅผ ๋–ผ์–ด๋‚ด๊ณ  ์•„๊นŒ ์ˆ˜์ •ํ–ˆ๋˜ $PROFILE์— Set-PoshPrompt -Theme ์˜ต์…˜์„ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค!

 

 

ํŠน์ • ํฐํŠธ๋“ค์€ ๊นจ์ ธ์„œ ์™  ๋„ค๋ชจ๋ธ”๋Ÿญ์ด ๋‚˜ํƒ€๋‚˜๊ณค ํ•˜๋Š”๋ฐ ์ด๋• ๋‹นํ™ฉํ•˜์ง€๋ง๊ณ  ์ง€์›ํ•˜๋Š” ํฐํŠธ๋กœ ๋ฐ”๊ฟ”์ฃผ๋ฉด๋œ๋‹ค.

 

Tip. ํฐํŠธ๋Š” Windows Terminal ์„ค์ •์ฐฝ( Setting.json )์„ ์—ด์–ด์„œ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค!

์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค๋ฉด ๋ณธ ํฌ์ŠคํŒ… ๋งจ ์œ„์˜ '๋“ค์–ด๊ฐ€๊ธฐ ์ „์—' ๊ตฌ๊ฐ„์˜ 2๊ฐ€์ง€ ํฌ์ŠคํŒ…์„ ์ฐธ๊ณ ํ•˜์ž!

 

 

 


Thanks for ๐Ÿ™ˆ