Skip to content

Commit 384699a

Browse files
committed
remove closeonctrlc functionality
1 parent 5eb75b2 commit 384699a

7 files changed

Lines changed: 6 additions & 21 deletions

File tree

tsunami/app/tsunamiapp.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type SSEvent struct {
3636

3737
type AppOpts struct {
3838
Title string // window title
39-
CloseOnCtrlC bool
4039
GlobalKeyboardEvents bool
4140
}
4241

@@ -133,7 +132,6 @@ func getFaviconPath() string {
133132
func (c *Client) makeBackendOpts() *rpctypes.VDomBackendOpts {
134133
return &rpctypes.VDomBackendOpts{
135134
Title: c.AppOpts.Title,
136-
CloseOnCtrlC: c.AppOpts.CloseOnCtrlC,
137135
GlobalKeyboardEvents: c.AppOpts.GlobalKeyboardEvents,
138136
FaviconPath: getFaviconPath(),
139137
}

tsunami/demo/pomodoro/app.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import (
1111

1212
func init() {
1313
app.SetAppOpts(app.AppOpts{
14-
CloseOnCtrlC: true,
15-
Title: "Pomodoro Timer (Tsunami Demo)",
14+
Title: "Pomodoro Timer (Tsunami Demo)",
1615
})
1716
}
1817

tsunami/demo/todo/app.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import (
1010
)
1111

1212
func init() {
13-
// Set up the default client with embedded Tailwind styles and ctrl-c handling
13+
// Set up the default client with embedded Tailwind styles
1414
app.SetAppOpts(app.AppOpts{
15-
CloseOnCtrlC: true,
16-
Title: "Todo App (Tsunami Demo)",
15+
Title: "Todo App (Tsunami Demo)",
1716
})
1817
}
1918

tsunami/frontend/src/model/tsunami-model.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ export class TsunamiModel {
180180
}
181181

182182
keyDownHandler(e: VDomKeyboardEvent): boolean {
183-
if (this.backendOpts?.closeonctrlc && checkKeyPressed(e, "Ctrl:c")) {
184-
this.shouldDispose = true;
185-
this.queueUpdate(true);
186-
return true;
187-
}
188183
if (this.backendOpts?.globalkeyboardevents) {
189184
if (e.cmd || e.meta) {
190185
return false;

tsunami/frontend/src/types/vdom.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ type VDomAsyncInitiationRequest = {
1010

1111
// vdom.VDomBackendOpts
1212
type VDomBackendOpts = {
13-
closeonctrlc?: boolean;
1413
globalkeyboardevents?: boolean;
1514
title?: string;
1615
faviconpath?: string;

tsunami/prompt.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ Tsunami applications use a default client configured through `app.SetAppOpts()`
2222
func init() {
2323
// Set up the default client with options
2424
app.SetAppOpts(app.AppOpts{
25-
CloseOnCtrlC: true,
26-
Title: "My Tsunami App",
25+
Title: "My Tsunami App",
2726
})
2827
}
2928

@@ -590,7 +589,6 @@ vdom.H("div", map[string]any{
590589
```go
591590
func init() {
592591
app.SetAppOpts(app.AppOpts{
593-
CloseOnCtrlC: true,
594592
GlobalKeyboardEvents: true, // Enable global keyboard events
595593
Title: "My Tsunami App",
596594
})
@@ -715,10 +713,9 @@ import (
715713
)
716714

717715
func init() {
718-
// Set up the default client with Tailwind styles and ctrl-c handling
716+
// Set up the default client with Tailwind styles
719717
app.SetAppOpts(app.AppOpts{
720-
CloseOnCtrlC: true,
721-
Title: "My Tsunami App",
718+
Title: "My Tsunami App",
722719
})
723720
}
724721

@@ -853,7 +850,6 @@ Key points:
853850
```
854851
type AppOpts struct {
855852
Title string // window title
856-
CloseOnCtrlC bool
857853
GlobalKeyboardEvents bool
858854
}
859855
```

tsunami/rpctypes/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ type VDomRefUpdate struct {
169169

170170
type VDomBackendOpts struct {
171171
Title string `json:"title,omitempty"`
172-
CloseOnCtrlC bool `json:"closeonctrlc,omitempty"`
173172
GlobalKeyboardEvents bool `json:"globalkeyboardevents,omitempty"`
174173
FaviconPath string `json:"faviconpath,omitempty"`
175174
}

0 commit comments

Comments
 (0)