From 8939c57dd81e7ad636fdc09957916ef6d85d657e Mon Sep 17 00:00:00 2001 From: sawka Date: Sun, 30 Oct 2022 12:52:58 -0700 Subject: [PATCH] minor, add isempty func for shellstate --- pkg/packet/packet.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/packet/packet.go b/pkg/packet/packet.go index f409ec9d..553c5b2e 100644 --- a/pkg/packet/packet.go +++ b/pkg/packet/packet.go @@ -120,6 +120,10 @@ type ShellState struct { Error string `json:"error,omitempty"` } +func (state ShellState) IsEmpty() bool { + return state.Version == "" && state.Cwd == "" && len(state.ShellVars) == 0 && state.Aliases == "" && state.Funcs == "" && state.Error == "" +} + type CmdDataPacketType struct { Type string `json:"type"` RespId string `json:"respid"`