Skip to content

Commit 446a93c

Browse files
committed
swith from term:debugconn to term:conndebug for consistency
1 parent 74c402c commit 446a93c

File tree

7 files changed

+13
-38
lines changed

7 files changed

+13
-38
lines changed

frontend/app/view/term/term.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ class TermViewModel implements ViewModel {
682682
},
683683
});
684684
}
685-
const debugConn = blockData?.meta?.["term:debugconn"];
685+
const debugConn = blockData?.meta?.["term:conndebug"];
686686
fullMenu.push({
687687
label: "Debug Connection",
688688
submenu: [
@@ -693,7 +693,7 @@ class TermViewModel implements ViewModel {
693693
click: () => {
694694
RpcApi.SetMetaCommand(TabRpcClient, {
695695
oref: WOS.makeORef("block", this.blockId),
696-
meta: { "term:debugconn": null },
696+
meta: { "term:conndebug": null },
697697
});
698698
},
699699
},
@@ -704,7 +704,7 @@ class TermViewModel implements ViewModel {
704704
click: () => {
705705
RpcApi.SetMetaCommand(TabRpcClient, {
706706
oref: WOS.makeORef("block", this.blockId),
707-
meta: { "term:debugconn": "info" },
707+
meta: { "term:conndebug": "info" },
708708
});
709709
},
710710
},
@@ -715,7 +715,7 @@ class TermViewModel implements ViewModel {
715715
click: () => {
716716
RpcApi.SetMetaCommand(TabRpcClient, {
717717
oref: WOS.makeORef("block", this.blockId),
718-
meta: { "term:debugconn": "debug" },
718+
meta: { "term:conndebug": "debug" },
719719
});
720720
},
721721
},

frontend/types/gotypes.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ declare global {
303303
"conn:wshenabled"?: boolean;
304304
"conn:askbeforewshinstall"?: boolean;
305305
"conn:overrideconfig"?: boolean;
306+
"conn:wshpath"?: string;
306307
"display:hidden"?: boolean;
307308
"display:order"?: number;
308309
"term:*"?: boolean;
@@ -508,7 +509,7 @@ declare global {
508509
"term:vdomtoolbarblockid"?: string;
509510
"term:transparency"?: number;
510511
"term:allowbracketedpaste"?: boolean;
511-
"term:debugconn"?: string;
512+
"term:conndebug"?: string;
512513
"web:zoom"?: number;
513514
"web:hidenav"?: boolean;
514515
"markdown:fontsize"?: number;

pkg/remote/connutil.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/wavetermdev/waveterm/pkg/util/shellutil"
2121
"github.com/wavetermdev/waveterm/pkg/wavebase"
2222
"golang.org/x/crypto/ssh"
23-
"golang.org/x/mod/semver"
2423
)
2524

2625
var userHostRe = regexp.MustCompile(`^([a-zA-Z0-9][a-zA-Z0-9._@\\-]*@)?([a-zA-Z0-9][a-zA-Z0-9.-]*)(?::([0-9]+))?$`)
@@ -55,32 +54,6 @@ func DetectShell(client *ssh.Client) (string, error) {
5554
return fmt.Sprintf(`"%s"`, strings.TrimSpace(string(out))), nil
5655
}
5756

58-
// returns a valid semver version string
59-
func GetWshVersion(client *ssh.Client) (string, error) {
60-
wshPath := GetWshPath(client)
61-
62-
session, err := client.NewSession()
63-
if err != nil {
64-
return "", err
65-
}
66-
67-
out, err := session.Output(wshPath + " version")
68-
if err != nil {
69-
return "", err
70-
}
71-
// output is expected to be in the form of "wsh v0.10.4"
72-
// should strip off the "wsh" prefix, and return a semver object
73-
fields := strings.Fields(strings.TrimSpace(string(out)))
74-
if len(fields) != 2 {
75-
return "", fmt.Errorf("unexpected output from wsh version: %s", out)
76-
}
77-
wshVersion := strings.TrimSpace(fields[1])
78-
if !semver.IsValid(wshVersion) {
79-
return "", fmt.Errorf("invalid semver version: %s", wshVersion)
80-
}
81-
return wshVersion, nil
82-
}
83-
8457
func GetWshPath(client *ssh.Client) string {
8558
defaultPath := wavebase.RemoteFullWshBinPath
8659
session, err := client.NewSession()

pkg/waveobj/metaconsts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const (
9595
MetaKey_TermVDomToolbarBlockId = "term:vdomtoolbarblockid"
9696
MetaKey_TermTransparency = "term:transparency"
9797
MetaKey_TermAllowBracketedPaste = "term:allowbracketedpaste"
98-
MetaKey_TermDebugConn = "term:debugconn"
98+
MetaKey_TermConnDebug = "term:conndebug"
9999

100100
MetaKey_WebZoom = "web:zoom"
101101
MetaKey_WebHideNav = "web:hidenav"

pkg/waveobj/wtypemeta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type MetaTSType struct {
9696
TermVDomToolbarBlockId string `json:"term:vdomtoolbarblockid,omitempty"`
9797
TermTransparency *float64 `json:"term:transparency,omitempty"` // default 0.5
9898
TermAllowBracketedPaste *bool `json:"term:allowbracketedpaste,omitempty"`
99-
TermDebugConn string `json:"term:debugconn,omitempty"` // null, info, debug
99+
TermConnDebug string `json:"term:conndebug,omitempty"` // null, info, debug
100100

101101
WebZoom float64 `json:"web:zoom,omitempty"`
102102
WebHideNav *bool `json:"web:hidenav,omitempty"`

pkg/wshrpc/wshrpctypes.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,10 @@ type CommandRemoteWriteFileData struct {
465465
}
466466

467467
type ConnKeywords struct {
468-
ConnWshEnabled *bool `json:"conn:wshenabled,omitempty"`
469-
ConnAskBeforeWshInstall *bool `json:"conn:askbeforewshinstall,omitempty"`
470-
ConnOverrideConfig bool `json:"conn:overrideconfig,omitempty"`
468+
ConnWshEnabled *bool `json:"conn:wshenabled,omitempty"`
469+
ConnAskBeforeWshInstall *bool `json:"conn:askbeforewshinstall,omitempty"`
470+
ConnOverrideConfig bool `json:"conn:overrideconfig,omitempty"`
471+
ConnWshPath string `json:"conn:wshpath,omitempty"`
471472

472473
DisplayHidden *bool `json:"display:hidden,omitempty"`
473474
DisplayOrder float32 `json:"display:order,omitempty"`

pkg/wshrpc/wshserver/wshserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ func termCtxWithLogBlockId(ctx context.Context, logBlockId string) context.Conte
619619
if err != nil {
620620
return ctx
621621
}
622-
connDebug := block.Meta.GetString(waveobj.MetaKey_TermDebugConn, "")
622+
connDebug := block.Meta.GetString(waveobj.MetaKey_TermConnDebug, "")
623623
if connDebug == "" {
624624
return ctx
625625
}

0 commit comments

Comments
 (0)