From 865374a0f557019028ac3cd9129eb6b8672350bb Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 9 May 2023 11:37:37 +0200 Subject: [PATCH] fix(image): add background reset sequence --- src/engine/image.go | 5 +++++ themes/1_shell.omp.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/image.go b/src/engine/image.go index 03be212e..a9ca6d28 100644 --- a/src/engine/image.go +++ b/src/engine/image.go @@ -73,6 +73,7 @@ const ( overlineReset = "overliner" strikethrough = "strikethrough" strikethroughReset = "strikethroughr" + backgroundReset = "backgroundr" color16 = "color16" left = "left" lineChange = "linechange" @@ -186,6 +187,7 @@ func (ir *ImageRenderer) Init(env platform.Environment) error { overlineReset: `^(?P\x1b\[55m)`, strikethrough: `^(?P\x1b\[9m)`, strikethroughReset: `^(?P\x1b\[29m)`, + backgroundReset: `^(?P\x1b\[49m)`, color16: `^(?P\x1b\[(?P[349][0-7]|10[0-7]|39)m)`, left: `^(?P\x1b\[(\d{1,3})D)`, lineChange: `^(?P\x1b\[(\d)[FB])`, @@ -566,6 +568,9 @@ func (ir *ImageRenderer) shouldPrint() bool { ir.foregroundColor = ir.defaultForegroundColor ir.backgroundColor = nil return false + case backgroundReset: + ir.backgroundColor = nil + return false case bold, italic, underline, overline: ir.style = sequence return false diff --git a/themes/1_shell.omp.json b/themes/1_shell.omp.json index f6e92d95..961c118b 100644 --- a/themes/1_shell.omp.json +++ b/themes/1_shell.omp.json @@ -90,7 +90,7 @@ "leading_diamond": "<#00c7fc> \ue285 <#ffafd2>{", "properties": { "folder_icon": "\uf07b", - "folder_separator_icon": "\uebcb", + "folder_separator_icon": " \uebcb ", "home_icon": "home", "style": "agnoster_full" },