Attempt 2 at enabling UTF8 by default on new WT
MODIFY
config/flags_windows.go
config/flags_windows.go
package config
+import (
+ "os"
+ "strings"
+)
+
// DisableUTF8 set to true will cause cordless to replace characters with a
// codepoint higher than 65536 or a runewidth of more than one character.
-var DisableUTF8 = true
+var DisableUTF8 bool
+
+func init() {
+ wtSessionValue, avail := os.LookupEnv("WT_SESSION")
+ DisableUTF8 = !avail || strings.TrimSpace(wtSessionValue) == ""
+}

MODIFY
flags_windows.go
flags_windows.go
@@ -2,14 +2,10 @@ package main
import (
"flag"
- "os"
- "strings"
"github.com/Bios-Marcel/cordless/config"
)
func init() {
- wtSessionValue, avail := os.LookupEnv("WT_SESSION")
- disableUTF8Default = !avail || strings.TrimSpace(wtSessionValue) == ""
- flag.BoolVar(&config.DisableUTF8, "disable-UTF8", disableUTF8Default, "Replaces certain characters with question marks in order to avoid broken rendering")
+ flag.BoolVar(&config.DisableUTF8, "disable-UTF8", config.DisableUTF8, "Replaces certain characters with question marks in order to avoid broken rendering")
}

Attempt 2 at enabling UTF8 by default on new WT