diff --git a/vlib/term/term.v b/vlib/term/term.v index 460c0b17aa..1378d696c6 100644 --- a/vlib/term/term.v +++ b/vlib/term/term.v @@ -173,8 +173,12 @@ fn imax(x int, y int) int { return if x > y { x } else { y } } +[manualfree] fn supports_escape_sequences(fd int) bool { vcolors_override := os.getenv('VCOLORS') + defer { + unsafe { vcolors_override.free() } + } if vcolors_override == 'always' { return true } @@ -182,11 +186,17 @@ fn supports_escape_sequences(fd int) bool { return false } env_term := os.getenv('TERM') + defer { + unsafe { env_term.free() } + } if env_term == 'dumb' { return false } $if windows { env_conemu := os.getenv('ConEmuANSI') + defer { + unsafe { env_conemu.free() } + } if env_conemu == 'ON' { return true }