How to appear your custom hostname in iTerm + p10k + oh-my-zsh
Vincent Jang
Posted on March 12, 2022
Recently, I re-learned about VIM, So I want to customize my terminal.
Actually, I already used a terminal iTerm
with Oh-My-Zsh
But when I installed and set powerlevel10k
, and something occurred.
HostName is missing.... :(
So I decided to bring missing hostname again.
Step 1 : Edit ~/.p10k.zsh
I used Vim for edit.
You can easily find POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
Just insert host
in POWERLEVEL9K_LEFT_PROMPT_ELEMENTS
where you want.
vim ~/.p10k.zsh
# in .p10k.zsh
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
os_icon # os identifier
host # hostname
dir # current directory
vcs # git status
prompt_char # prompt symbol
)
Step2 : customize hostname.
Note : Customize hostname may cause unexpected side effects.
scutil --set HostName
HostName: #input hostname you want
Step3 : Confirm result
source ~/.p10k.zsh
I successfully done.
I think is silly problem, but It really bother me..
I hope it will help people who wander like me.
Thank you for reading.
π πͺ π
π©
Vincent Jang
Posted on March 12, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.