Skip to content

Commit 14bd2d0

Browse files
committed
move allowtermlisten to a global config setting
1 parent cd36896 commit 14bd2d0

6 files changed

Lines changed: 30 additions & 25 deletions

File tree

frontend/types/gotypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,7 @@ declare global {
14321432
"term:bellsound"?: boolean;
14331433
"term:bellindicator"?: boolean;
14341434
"term:osc52"?: string;
1435+
"term:allowtermlisten"?: boolean;
14351436
"term:durable"?: boolean;
14361437
"term:showsplitbuttons"?: boolean;
14371438
"term:trimtrailingwhitespace"?: boolean;

pkg/blockcontroller/blockcontroller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ const (
5050
const DefaultTimeout = 2 * time.Second
5151
const DefaultGracefulKillWait = 400 * time.Millisecond
5252

53-
const AllowTermListen = true
54-
5553
type BlockInputUnion struct {
5654
InputData []byte `json:"inputdata,omitempty"`
5755
SigName string `json:"signame,omitempty"`

pkg/blockcontroller/shellcontroller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ func (bc *ShellController) manageRunningShellProcess(shellProc *shellexec.ShellP
534534
}()
535535
var termSrv *termlistensrv.TermListenSrv
536536
var ptyReader io.Reader = shellProc.Cmd
537-
if AllowTermListen {
537+
allowTermListen := wconfig.DefaultBoolPtr(wconfig.GetWatcher().GetFullConfig().Settings.TermAllowTermListen, true)
538+
if allowTermListen {
538539
termSrv = termlistensrv.MakeTermListenSrv(func(data []byte) {
539540
shellProc.Cmd.Write(data)
540541
})

pkg/wconfig/metaconsts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const (
5858
ConfigKey_TermBellSound = "term:bellsound"
5959
ConfigKey_TermBellIndicator = "term:bellindicator"
6060
ConfigKey_TermOsc52 = "term:osc52"
61+
ConfigKey_TermAllowTermListen = "term:allowtermlisten"
6162
ConfigKey_TermDurable = "term:durable"
6263
ConfigKey_TermShowSplitButtons = "term:showsplitbuttons"
6364
ConfigKey_TermTrimTrailingWhitespace = "term:trimtrailingwhitespace"

pkg/wconfig/settingsconfig.go

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,29 @@ type SettingsType struct {
9090
WaveAiShowCloudModes bool `json:"waveai:showcloudmodes,omitempty"`
9191
WaveAiDefaultMode string `json:"waveai:defaultmode,omitempty"`
9292

93-
TermClear bool `json:"term:*,omitempty"`
94-
TermFontSize float64 `json:"term:fontsize,omitempty"`
95-
TermFontFamily string `json:"term:fontfamily,omitempty"`
96-
TermTheme string `json:"term:theme,omitempty"`
97-
TermDisableWebGl bool `json:"term:disablewebgl,omitempty"`
98-
TermLocalShellPath string `json:"term:localshellpath,omitempty"`
99-
TermLocalShellOpts []string `json:"term:localshellopts,omitempty"`
100-
TermGitBashPath string `json:"term:gitbashpath,omitempty"`
101-
TermScrollback *int64 `json:"term:scrollback,omitempty"`
102-
TermCopyOnSelect *bool `json:"term:copyonselect,omitempty"`
103-
TermTransparency *float64 `json:"term:transparency,omitempty"`
104-
TermAllowBracketedPaste *bool `json:"term:allowbracketedpaste,omitempty"`
105-
TermShiftEnterNewline *bool `json:"term:shiftenternewline,omitempty"`
106-
TermMacOptionIsMeta *bool `json:"term:macoptionismeta,omitempty"`
107-
TermCursor string `json:"term:cursor,omitempty"`
108-
TermCursorBlink *bool `json:"term:cursorblink,omitempty"`
109-
TermBellSound *bool `json:"term:bellsound,omitempty"`
110-
TermBellIndicator *bool `json:"term:bellindicator,omitempty"`
111-
TermOsc52 string `json:"term:osc52,omitempty" jsonschema:"enum=focus,enum=always"`
112-
TermDurable *bool `json:"term:durable,omitempty"`
113-
TermShowSplitButtons bool `json:"term:showsplitbuttons,omitempty"`
114-
TermTrimTrailingWhitespace *bool `json:"term:trimtrailingwhitespace,omitempty"`
93+
TermClear bool `json:"term:*,omitempty"`
94+
TermFontSize float64 `json:"term:fontsize,omitempty"`
95+
TermFontFamily string `json:"term:fontfamily,omitempty"`
96+
TermTheme string `json:"term:theme,omitempty"`
97+
TermDisableWebGl bool `json:"term:disablewebgl,omitempty"`
98+
TermLocalShellPath string `json:"term:localshellpath,omitempty"`
99+
TermLocalShellOpts []string `json:"term:localshellopts,omitempty"`
100+
TermGitBashPath string `json:"term:gitbashpath,omitempty"`
101+
TermScrollback *int64 `json:"term:scrollback,omitempty"`
102+
TermCopyOnSelect *bool `json:"term:copyonselect,omitempty"`
103+
TermTransparency *float64 `json:"term:transparency,omitempty"`
104+
TermAllowBracketedPaste *bool `json:"term:allowbracketedpaste,omitempty"`
105+
TermShiftEnterNewline *bool `json:"term:shiftenternewline,omitempty"`
106+
TermMacOptionIsMeta *bool `json:"term:macoptionismeta,omitempty"`
107+
TermCursor string `json:"term:cursor,omitempty"`
108+
TermCursorBlink *bool `json:"term:cursorblink,omitempty"`
109+
TermBellSound *bool `json:"term:bellsound,omitempty"`
110+
TermBellIndicator *bool `json:"term:bellindicator,omitempty"`
111+
TermOsc52 string `json:"term:osc52,omitempty" jsonschema:"enum=focus,enum=always"`
112+
TermAllowTermListen *bool `json:"term:allowtermlisten,omitempty"`
113+
TermDurable *bool `json:"term:durable,omitempty"`
114+
TermShowSplitButtons bool `json:"term:showsplitbuttons,omitempty"`
115+
TermTrimTrailingWhitespace *bool `json:"term:trimtrailingwhitespace,omitempty"`
115116

116117
EditorMinimapEnabled bool `json:"editor:minimapenabled,omitempty"`
117118
EditorStickyScrollEnabled bool `json:"editor:stickyscrollenabled,omitempty"`

schema/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
"always"
166166
]
167167
},
168+
"term:allowtermlisten": {
169+
"type": "boolean"
170+
},
168171
"term:durable": {
169172
"type": "boolean"
170173
},

0 commit comments

Comments
 (0)