## 経緯 [[IntelliJ IDEA]]や[[VSCode]]からターミナルを開く機会が増えたが、パスがいつも深くて横幅が足りないので...。 また、[[WSL2]]は2行プロンプトを使っており、2行プロンプトに対する抵抗もなくなってきたから。 ## 懸念 操作のもっさり感が上がると嫌かも。多分平気な気はしている。 ## TODO - [x] 既存の[[oh-my-posh]]実装を確認 - jsonぽい - [x] テーマ決め - [x] ブロック定義 ## 今の設定 ```json "blocks": [ { "alignment": "left", "segments": [ { "background": "#2f2f2f", "foreground": "#fafafa", "properties": { "style": "full" }, "style": "diamond", "template": " {{ .Path }} ", "type": "path" }, { "background": "#2f2f2f", "foreground": "#96E072", "foreground_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb3b{{ end }}", "{{ if gt .Ahead 0 }}#8A4FFF{{ end }}", "{{ if gt .Behind 0 }}#c42ebd{{ end }}" ], "properties": { "branch_icon": " \uf126 ", "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true }, "style": "diamond", "template": "<#7a7a7a>\ue0b1 </>{{ .HEAD }} {{ .BranchStatus }}{{ if .Working.Changed }} \uf044 <#E84855>{{ .Working.String }}</>{{ end }}{{ if and (.Staging.Changed) (.Working.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uf6b9<#ffeb3b>{{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0}} \uf692 {{ .StashCount }}{{ end }}{{ if gt .WorktreeCount 0}} \uf1bb {{ .WorktreeCount }}{{ end }} ", "type": "git" }, { "background": "#2f2f2f", "foreground": "#6CA35E", "style": "diamond", "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}<#7a7a7a> \ue0b1</>", "type": "node" }, { "background": "#2f2f2f", "foreground": "#96E072", "style": "diamond", "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b1</>", "type": "python" }, { "background": "#2f2f2f", "foreground": "#3891A6", "style": "diamond", "template": " \ue77f {{ if .Unsupported }}\uf071{{ else }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b1</>", "type": "dotnet" }, { "background": "#2f2f2f", "foreground": "#7FD5EA", "style": "diamond", "template": " \ufcd1{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#7a7a7a> \ue0b1</>", "type": "go" }, { "background": "#2f2f2f", "background_templates": ["{{ if gt .Code 0 }}#e91e63{{ end }}"], "foreground": "#ffffff", "properties": { "always_enabled": true }, "style": "diamond", "trailing_diamond": "\ue0b4", "type": "exit" } ], "type": "prompt" } ], ``` ## 対応後 https://github.com/tadashi-aikawa/owl-playbook/tree/798ce57