[{"data":1,"prerenderedAt":269},["ShallowReactive",2],{"\u002F2026\u002F10003-terminal_better_macos":3,"surround-\u002F2026\u002F10003-terminal_better_macos":263},{"id":4,"title":5,"body":6,"categories":236,"date":238,"description":239,"draft":240,"extension":241,"hidden":240,"image":242,"meta":243,"navigation":245,"path":246,"permalink":247,"published":247,"readingTime":248,"recommend":253,"references":247,"seo":254,"sitemap":255,"stem":256,"tags":257,"type":261,"updated":238,"__hash__":262},"content\u002Fposts\u002F2026\u002F10003-Terminal_Better_Macos.md","Macos终端美化",{"type":7,"value":8,"toc":225},"minimark",[9,13,26,30,33,38,45,50,60,66,69,75,82,87,90,96,101,104,110,114,123,127,133,138,145,151,158,173,190,196,203,207,210],[10,11,12],"h2",{"id":12},"前言",[14,15,16,17,21,22,25],"p",{},"最近在公司基本上都在使用Macos开发，",[18,19,20],"code",{"code":20},"Vibe Code","时代，装完各种AI的cli后，终端一开就是干！不过Macos的原生终端还是太素了，一番查阅后，发现终端美化主要使用",[18,23,24],{"code":24},"oh-my-posh","这个东西，一番研究，实现成功后，现在记录一下。",[27,28],"pic",{"src":29},"assets\u002Fblog_image\u002F10003-01.png",[10,31,32],{"id":32},"步骤",[34,35,37],"h3",{"id":36},"_1-安装homebrew","1. 安装Homebrew",[14,39,40,41,44],{},"Homebrew是一个Macos的包管理工具，安装完即可支持",[18,42,43],{"code":43},"brew","命令。",[14,46,47,49],{},[18,48,43],{"code":43},"常用命令如下：",[51,52,58],"pre",{"className":53,"code":55,"language":56,"meta":57},[54],"language-sh","brew install node #默认安装最新版\nbrew install node@14.16.8 #安装指定版本\nbrew switch node 16.0.0 #切换版本\nbrew upgrade name #更新安装过的软件(如果不加软件名，就更新所有可以更新的软件)\nbrew uninstall node #卸载node\n\nbrew services list #获取services列表\nbrew services start\u002Fstop\u002Frestart serverName # 启动服务\nbrew services start mysql #启动mysql服务\nbrew services restart mysql #重启mysql服务\nbrew services stop mysql #停止mysql服务\n\nbrew config #查看brew配置\nbrew info node #查看node安装信息\nbrew list #查看已安装软件\nbrew list --versions #查看已安装软件版本号\nbrew search node #搜索可用node相关软件\nbrew update #brew自身更新\nbrew cleanup #清除下载的缓存\nbrew doctor #诊断brew，并给出修复命令\n","sh","",[18,59,55],{"__ignoreMap":57},[14,61,62],{},[63,64,65],"strong",{},"安装",[14,67,68],{},"执行以下安装命令即可：",[51,70,73],{"className":71,"code":72,"language":56,"meta":57},[54],"\u002Fbin\u002Fzsh -c \"$(curl -fsSL https:\u002F\u002Fgitee.com\u002Fcunkai\u002FHomebrewCN\u002Fraw\u002Fmaster\u002FHomebrew.sh)\"\n",[18,74,72],{"__ignoreMap":57},[14,76,77,78,81],{},"执行",[18,79,80],{"code":80},"brew --version","查看是否有输出版本信息，有则代表安装成功。",[14,83,84],{},[63,85,86],{},"更换到国内下载源",[14,88,89],{},"执行以下命令（三选一）：",[51,91,94],{"className":92,"code":93,"language":56,"meta":57},[54],"git -C \"$(brew --repo)\" remote set-url origin https:\u002F\u002Fmirrors.ustc.edu.cn\u002Fbrew.git # 中科大\ngit -C \"$(brew --repo)\" remote set-url origin https:\u002F\u002Fmirrors.aliyun.com\u002Fhomebrew\u002Fbrew.git # 阿里巴巴\ngit -C \"$(brew --repo)\" remote set-url origin https:\u002F\u002Fmirrors.tuna.tsinghua.edu.cn\u002Fgit\u002Fhomebrew\u002Fbrew.git # 清华大学\n",[18,95,93],{"__ignoreMap":57},[14,97,98],{},[63,99,100],{},"恢复默认源",[14,102,103],{},"如果国内源不可用，或者某些因素导致我们需要切回原本的默认源，执行以下命令即可：",[51,105,108],{"className":106,"code":107,"language":56,"meta":57},[54],"git -C \"$(brew --repo)\" remote set-url origin https:\u002F\u002Fgithub.com\u002FHomebrew\u002Fbrew.git\ngit -C \"$(brew --repo homebrew\u002Fcore)\" remote set-url origin https:\u002F\u002Fgithub.com\u002FHomebrew\u002Fhomebrew-core.git\ngit -C \"$(brew --repo homebrew\u002Fcask)\" remote set-url origin https:\u002F\u002Fgithub.com\u002FHomebrew\u002Fhomebrew-cask.git\n删除环境变量 HOMEBREW_BOTTLE_DOMAIN\nsource ~\u002F.bash_profile\nbrew update\n",[18,109,107],{"__ignoreMap":57},[34,111,113],{"id":112},"_2-安装oh-my-posh","2. 安装oh-my-posh",[14,115,116,122],{},[117,118,24],"a",{"href":119,"rel":120},"https:\u002F\u002Fohmyposh.dev\u002F",[121],"nofollow","是目前用的比较多的终端主题，兼容多个平台，win11也可以用。",[14,124,125],{},[63,126,65],{},[51,128,131],{"className":129,"code":130,"language":56,"meta":57},[54],"brew install jandedobbeleer\u002Foh-my-posh\u002Foh-my-posh\n",[18,132,130],{"__ignoreMap":57},[14,134,135],{},[63,136,137],{},"安装字体",[14,139,140,141,144],{},"由于该主题终端会展示文本图标，需要对应的字体，所以需要额外安任意一款",[18,142,143],{"code":143},"Nerd Font","字体。",[14,146,147,148],{},"下载地址为：",[18,149,150],{"code":150},"https:\u002F\u002Fwww.nerdfonts.com\u002Ffont-downloads",[14,152,153,154,157],{},"下载完成后，双击打开",[18,155,156],{"code":156},".ttf","后缀的文件，即可安装。",[14,159,160,161,164,165,168,169,172],{},"安装成功后，打开",[18,162,163],{"code":163},"终端","，点击左上角",[18,166,167],{"code":167},"设置","，点击",[18,170,171],{"code":171},"描述文件","，找的目前选择的样式，然后点字体，切换到刚才下载的字体即可。",[14,174,175,178,179,182,183,186,187,189],{},[63,176,177],{},"配置","\n修改",[18,180,181],{"code":181},".zshrc","文件，输入以下内容，其中",[18,184,185],{"code":185},"markbull.omp","为你使用的",[18,188,24],{"code":24},"主题名称，注意大小写。：",[51,191,194],{"className":192,"code":193,"language":56,"meta":57},[54],"eval \"$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)\u002Fthemes\u002Fmarkbull.omp.json)\"\n",[18,195,193],{"__ignoreMap":57},[14,197,198,199,202],{},"配置好后，执行",[18,200,201],{"code":201},"source ~\u002F.zshrc","即可生效",[34,204,206],{"id":205},"vscode终端适配","VsCode终端适配",[14,208,209],{},"因为我经常在VsCode中使用终端，但是它的字体是独立配置的，所以还需要调整下。",[14,211,212,213,216,217,220,221,224],{},"VsCode中打开",[18,214,215],{"code":215},"settings","，在搜索栏输入",[18,218,219],{"code":219},"Terminal › Integrated: Font Family"," ，在搜索结果的下方输入你的字体名称就行，比如我输入的就是",[18,222,223],{"code":223},"FiraCode Nerd Font","。",{"title":57,"searchDepth":226,"depth":226,"links":227},4,[228,230],{"id":12,"depth":229,"text":12},2,{"id":32,"depth":229,"text":32,"children":231},[232,234,235],{"id":36,"depth":233,"text":37},3,{"id":112,"depth":233,"text":113},{"id":205,"depth":233,"text":206},[237],"技术","2026-05-07 14:51:16","终端啥都好，就是太素了，整点花活！",false,"md","assets\u002Fcover\u002Fcover-10003.png",{"slots":244},{},true,"\u002F2026\u002F10003-terminal_better_macos",null,{"text":249,"minutes":250,"time":251,"words":252},"4 min read",3.685,221100,737,100,{"title":5,"description":239},{"loc":246},"posts\u002F2026\u002F10003-Terminal_Better_Macos",[258,259,260],"Macos","Terminal","Beautify","tech","UOR6zdlIKEdsMkbjjkx1OpSDQSOzDkSNskCIKgpFQEk",[264,247],{"title":265,"path":266,"stem":267,"date":268,"type":261,"children":-1},"一行命令解锁JetBrains全家桶！","\u002F2026\u002F10002-ide_init_config_win","posts\u002F2026\u002F10002-ide_init_config_win","2026-05-05 17:54:54",1778505257998]