2026-03-29-oh-my-posh配置分享

First Post:

Last Update:

Page View: loading...

作为落魄软开人,终端命令行(CLI)无疑是我们日常工作中不可或缺的工具之一。因此想拥有一个既美观又实用的终端界面,不至于天天盯着那个黑框框,感觉那个比较单调乏味~

官方网站,教程在里面
https://ohmyposh.dev/

先看美化完成后的结果:

alt text
alt text

配置分享:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#00CCFF",
"style": "plain",
"template": "<#00CCFF># </><#00CCFF>{{ .UserName }}</> <#FFFFFF>in</> <#00FFAA>{{ .HostName }}</> ",
"type": "session"
},
{
"foreground": "#00BFFF",
"properties": {
"folder_icon": "\uf115",
"folder_separator_icon": " \ue0b1 ",
"style": "folder"
},
"style": "plain",
"template": " {{ .Path }} ",
"type": "path"
},
{
"foreground": "#00BFFF",
"style": "plain",
"template": "{{ .HEAD }} ",
"type": "git"
}
],
"type": "prompt"
},
{
"alignment": "right",
"segments": [
{
"foreground": "#FFFFFF",
"style": "plain",
"template": "[{{ .CurrentDate | date .Format }}]",
"type": "time"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": true,
"segments": [
{
"foreground": "#00FFAA",
"style": "plain",
"template": "\uf0e7 ",
"type": "root"
},
{
"foreground": "#FFFFFF",
"style": "plain",
"template": "\ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
"type": "python"
},
{
"foreground": "#FF5555",
"style": "plain",
"template": " {{ reason .Code }} ",
"type": "status"
},
{
"foreground": "#FFFFFF",
"style": "plain",
"template": ">_ ",
"type": "text"
}
],
"type": "prompt"
}
],
"final_space": true,
"version": 3
}