From bed191186c06083490d0c44ac94147e671e12115 Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Wed, 27 Mar 2024 13:07:24 -0700 Subject: [PATCH] allow empty pvars (important to *unset* the git directory when you leave it) (#507) --- waveshell/pkg/shellapi/shellapi.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/waveshell/pkg/shellapi/shellapi.go b/waveshell/pkg/shellapi/shellapi.go index aff1ca1a..3742c432 100644 --- a/waveshell/pkg/shellapi/shellapi.go +++ b/waveshell/pkg/shellapi/shellapi.go @@ -19,7 +19,6 @@ import ( "syscall" "time" - "github.com/alessio/shellescape" "github.com/creack/pty" "github.com/wavetermdev/waveterm/waveshell/pkg/base" "github.com/wavetermdev/waveterm/waveshell/pkg/packet" @@ -278,12 +277,11 @@ func parseExtVarOutput(pvarBytes []byte, promptOutput string, zmodsOutput string if pvarFields[0] == "" { continue } - if pvarFields[1] == "" { - continue - } + name := pvarFields[0] + val := pvarFields[1] decl := &DeclareDeclType{IsExtVar: true} - decl.Name = "PROMPTVAR_" + pvarFields[0] - decl.Value = shellescape.Quote(pvarFields[1]) + decl.Name = "PROMPTVAR_" + name + decl.Value = val declMap[decl.Name] = decl } if promptOutput != "" {