Skip to content

Commit 7d3629c

Browse files
fix: use full block for spaces
1 parent c73d197 commit 7d3629c

20 files changed

+148
-30
lines changed

docs/docs/configuration.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ You can use these on any segment, the engine is responsible for adding them corr
182182
##### Prefix
183183

184184
The string content will be put in front of the segment's output text. Useful for symbols, text or other customizations.
185+
Defaults to `<color>\u2588</>` where `color` is the background color of the segment.
185186

186187
##### Postfix
187188

188189
The string content will be put after the segment's output text. Useful for symbols, text or other customizations.
190+
Defaults to `<color>\u2588</>` where `color` is the background color of the segment.
189191

190192
##### Ignore Folders
191193

@@ -200,9 +202,10 @@ segment's configuration will not render it when in that location. The engine wil
200202

201203
#### Colors
202204

203-
You have the ability to override the foreground and/or background color for text in any property that accepts it. The syntax is custom but
204-
should be rather straighforward: `<#ffffff,#000000>this is white with black background</> <#FF479C>but this is pink</>`. Anything between the color start
205-
`<#FF479C>` and end `</>` will be colored accordingly.
205+
You have the ability to override the foreground and/or background color for text in any property that accepts it.
206+
The syntax is custom but should be rather straighforward:
207+
`<#ffffff,#000000>this is white with black background</> <#FF479C>but this is pink</>`.
208+
Anything between the color start `<#FF479C>` and end `</>` will be colored accordingly.
206209

207210
For example, if you want `prefix` to print a colored bracket which isn't the same as the segment's `foreground`, you can
208211
do so like this:
@@ -224,12 +227,11 @@ To change *only* the background color, just omit the first color from the above
224227
```
225228

226229
Oh my Posh mainly supports three different color types being
227-
* Typical [hex colors][hexcolors] (for example `#CB4B16`).
228230

229-
* The `transparent` keyword which can be used to create either a transparent foreground override
231+
- Typical [hex colors][hexcolors] (for example `#CB4B16`).
232+
- The `transparent` keyword which can be used to create either a transparent foreground override
230233
or transparent background color using the segement's foreground property.
231-
232-
* 16 [ANSI color names][ansicolors].
234+
- 16 [ANSI color names][ansicolors].
233235

234236
These include 8 basic ANSI colors and `default`:
235237

@@ -254,6 +256,7 @@ Oh my Posh mainly supports three different color types being
254256
"type": "time",
255257
"style": "plain",
256258
"foreground": "#007ACC",
259+
"background": "transparent",
257260
"properties": {
258261
"time_format": "15:04:05"
259262
}

engine.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ func (e *engine) renderDiamondSegment(text string) {
6464
}
6565

6666
func (e *engine) renderText(text string) {
67-
prefix := e.activeSegment.getValue(Prefix, " ")
68-
postfix := e.activeSegment.getValue(Postfix, " ")
67+
defaultValue := fmt.Sprintf("<%s>\u2588</>", e.activeSegment.Background)
68+
prefix := e.activeSegment.getValue(Prefix, defaultValue)
69+
postfix := e.activeSegment.getValue(Postfix, defaultValue)
6970
e.renderer.write(e.activeSegment.Background, e.activeSegment.Foreground, fmt.Sprintf("%s%s%s", prefix, text, postfix))
7071
if *e.env.getArgs().Debug {
7172
e.renderer.write(e.activeSegment.Background, e.activeSegment.Foreground, fmt.Sprintf("(%s:%s)", e.activeSegment.Type, e.activeSegment.timing))

themes/agnosterplus.omp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"type": "time",
1010
"style": "plain",
1111
"foreground": "#007ACC",
12+
"background": "transparent",
1213
"properties": {
1314
"time_format": "15:04:05"
1415
}

themes/avit.omp.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "path",
99
"style": "plain",
1010
"foreground": "#ffffff",
11+
"background": "transparent",
1112
"properties": {
1213
"prefix": "",
1314
"style": "short"
@@ -16,17 +17,23 @@
1617
{
1718
"type": "git",
1819
"style": "plain",
19-
"foreground": "#C2C206"
20+
"foreground": "#C2C206",
21+
"background": "transparent",
22+
"properties": {
23+
"prefix": ""
24+
}
2025
},
2126
{
2227
"type": "root",
2328
"style": "plain",
24-
"foreground": "#B5B50D"
29+
"foreground": "#B5B50D",
30+
"background": "transparent"
2531
},
2632
{
2733
"type": "exit",
2834
"style": "plain",
2935
"foreground": "#C94A16",
36+
"background": "transparent",
3037
"properties": {
3138
"prefix": "x"
3239
}
@@ -44,8 +51,10 @@
4451
"type": "text",
4552
"style": "plain",
4653
"foreground": "#007ACC",
54+
"background": "transparent",
4755
"properties": {
4856
"prefix": "",
57+
"postfix": "",
4958
"text": "\uE602"
5059
}
5160
}

themes/darkblood.omp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "session",
99
"style": "plain",
1010
"foreground": "#ffffff",
11+
"background": "transparent",
1112
"properties": {
1213
"user_info_separator": "",
1314
"display_host": false,
@@ -19,6 +20,7 @@
1920
"type": "git",
2021
"style": "plain",
2122
"foreground": "#ffffff",
23+
"background": "transparent",
2224
"properties": {
2325
"prefix": "<#CB4B16>[</>",
2426
"postfix": "<#CB4B16>]</>"
@@ -28,6 +30,7 @@
2830
"type": "root",
2931
"style": "plain",
3032
"foreground": "#ffffff",
33+
"background": "transparent",
3134
"properties": {
3235
"prefix": "<#CB4B16>[</>",
3336
"postfix": "<#CB4B16>]</>"
@@ -37,6 +40,7 @@
3740
"type": "exit",
3841
"style": "plain",
3942
"foreground": "#ffffff",
43+
"background": "transparent",
4044
"properties": {
4145
"prefix": "<#CB4B16>[x</>",
4246
"postfix": "<#CB4B16>]</>"
@@ -55,6 +59,7 @@
5559
"type": "path",
5660
"style": "plain",
5761
"foreground": "#ffffff",
62+
"background": "transparent",
5863
"properties": {
5964
"style": "short",
6065
"prefix": "<#CB4B16>┖[</>",

themes/emodipt.omp.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "time",
99
"style": "plain",
1010
"foreground": "#E5C07B",
11+
"background": "transparent",
1112
"properties": {
1213
"time_format": "15:04:05",
1314
"prefix": "[",
@@ -17,12 +18,14 @@
1718
{
1819
"type": "root",
1920
"style": "plain",
20-
"foreground": "#B5B50D"
21+
"foreground": "#B5B50D",
22+
"background": "transparent"
2123
},
2224
{
2325
"type": "path",
2426
"style": "plain",
2527
"foreground": "#61AFEF",
28+
"background": "transparent",
2629
"properties": {
2730
"style": "agnoster",
2831
"postfix": " on"
@@ -32,6 +35,7 @@
3235
"type": "git",
3336
"style": "plain",
3437
"foreground": "#F3C267",
38+
"background": "transparent",
3539
"properties": {
3640
"display_status": true,
3741
"branch_identical_icon": "\uF14A",
@@ -42,6 +46,7 @@
4246
"type": "exit",
4347
"style": "plain",
4448
"foreground": "#C94A16",
49+
"background": "transparent",
4550
"properties": {
4651
"prefix": "x"
4752
}
@@ -50,13 +55,14 @@
5055
"type": "text",
5156
"style": "plain",
5257
"foreground": "#E06C75",
58+
"background": "transparent",
5359
"properties": {
5460
"prefix": "",
55-
"text": " \u276F"
61+
"text": "\u276F"
5662
}
5763
}
5864
]
5965
}
6066
],
61-
"final_space": true
67+
"final_space": false
6268
}

themes/fish.omp.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
"type": "exit",
99
"style": "plain",
1010
"foreground": "#ffffff",
11+
"background": "transparent",
1112
"properties": {
1213
"postfix": ""
1314
}
1415
},
1516
{
1617
"type": "root",
1718
"style": "plain",
18-
"foreground": "#100e23"
19+
"foreground": "#100e23",
20+
"background": "transparent"
1921
},
2022
{
2123
"type": "session",
2224
"style": "plain",
23-
"foreground": "#ffffff"
25+
"foreground": "#ffffff",
26+
"background": "transparent"
2427
},
2528
{
2629
"type": "path",
@@ -49,6 +52,7 @@
4952
"type": "text",
5053
"style": "plain",
5154
"foreground": "#007ACC",
55+
"background": "transparent",
5256
"properties": {
5357
"prefix": "",
5458
"text": "\uE0B0"

themes/honukai.omp.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "session",
99
"style": "plain",
1010
"foreground": "#FFFFFF",
11+
"background": "transparent",
1112
"properties": {
1213
"user_info_separator": " <#ffffff>in</> ",
1314
"prefix": "<#0377C8># </>",
@@ -19,6 +20,7 @@
1920
"type": "path",
2021
"style": "plain",
2122
"foreground": "#0973C0",
23+
"background": "transparent",
2224
"properties": {
2325
"folder_icon": "\uF115",
2426
"folder_separator_icon": "\uE0B1",
@@ -29,6 +31,7 @@
2931
"type": "git",
3032
"style": "plain",
3133
"foreground": "#B8B80A",
34+
"background": "transparent",
3235
"properties": {
3336
"prefix": "<#ffffff>on git:</>"
3437
}
@@ -43,6 +46,7 @@
4346
"type": "time",
4447
"style": "plain",
4548
"foreground": "#ffffff",
49+
"background": "transparent",
4650
"properties": {
4751
"prefix": "[",
4852
"postfix": "]"
@@ -61,6 +65,7 @@
6165
"type": "root",
6266
"style": "plain",
6367
"foreground": "#CECE04",
68+
"background": "transparent",
6469
"properties": {
6570
"prefix": ""
6671
}
@@ -69,19 +74,22 @@
6974
"type": "python",
7075
"style": "plain",
7176
"foreground": "#100e23",
77+
"background": "transparent",
7278
"properties": {
7379
"prefix": " \uE235 "
7480
}
7581
},
7682
{
7783
"type": "exit",
7884
"style": "plain",
79-
"foreground": "#CB4B16"
85+
"foreground": "#CB4B16",
86+
"background": "transparent"
8087
},
8188
{
8289
"type": "text",
8390
"style": "plain",
8491
"foreground": "#CC4B16",
92+
"background": "transparent",
8593
"properties": {
8694
"prefix": "",
8795
"text": "\u279C"
@@ -90,5 +98,5 @@
9098
]
9199
}
92100
],
93-
"final_space": true
101+
"final_space": false
94102
}

themes/lambda.omp.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "text",
99
"style": "plain",
1010
"foreground": "#F5F5F5",
11+
"background": "transparent",
1112
"properties": {
1213
"prefix": "",
1314
"text": "\uFB26"
@@ -17,20 +18,23 @@
1718
"type": "path",
1819
"style": "plain",
1920
"foreground": "#B80101",
21+
"background": "transparent",
2022
"properties": {
23+
"prefix": "",
2124
"style": "agnoster"
2225
}
2326
},
2427
{
2528
"type": "git",
2629
"style": "plain",
2730
"foreground": "#B80101",
31+
"background": "transparent",
2832
"properties": {
2933
"prefix": " <#F5F5F5>git:</>"
3034
}
3135
}
3236
]
3337
}
3438
],
35-
"final_space": true
39+
"final_space": false
3640
}

themes/material.omp.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "text",
99
"style": "plain",
1010
"foreground": "#ffffff",
11+
"background": "transparent",
1112
"properties": {
1213
"prefix": "",
1314
"text": "<#C591E8>\u276F</><#69FF94>\u276F</>"
@@ -17,14 +18,17 @@
1718
"type": "path",
1819
"style": "plain",
1920
"foreground": "#56B6C2",
21+
"background": "transparent",
2022
"properties": {
23+
"prefix": "",
2124
"style": "folder"
2225
}
2326
},
2427
{
2528
"type": "git",
2629
"style": "plain",
2730
"foreground": "#D0666F",
31+
"background": "transparent",
2832
"properties": {
2933
"branch_icon": "",
3034
"display_status": false,
@@ -36,6 +40,7 @@
3640
"type": "exit",
3741
"style": "plain",
3842
"foreground": "#DCB977",
43+
"background": "transparent",
3944
"properties": {
4045
"prefix": "\uD00D",
4146
"display_exit_code": false
@@ -45,12 +50,13 @@
4550
"type": "time",
4651
"style": "plain",
4752
"foreground": "#66F68F",
53+
"background": "transparent",
4854
"properties": {
4955
"time_format": "15:04"
5056
}
5157
}
5258
]
5359
}
5460
],
55-
"final_space": true
61+
"final_space": false
5662
}

0 commit comments

Comments
 (0)