Skip to content

Commit 5c3ce90

Browse files
Merge pull request #701 from ibuildthecloud/main
bug: don't also abort the program on double ctrl+c
2 parents c8cf310 + 97e9bcc commit 5c3ce90

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/google/uuid v1.6.0
1717
github.com/gptscript-ai/broadcaster v0.0.0-20240625175512-c43682019b86
1818
github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379
19-
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d
19+
github.com/gptscript-ai/cmd v0.0.0-20240802230653-326b7baf6fcb
2020
github.com/gptscript-ai/go-gptscript v0.9.4-0.20240801203434-840b14393b17
2121
github.com/gptscript-ai/tui v0.0.0-20240802053758-038d3eed9502
2222
github.com/hexops/autogold/v2 v2.2.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ github.com/gptscript-ai/broadcaster v0.0.0-20240625175512-c43682019b86 h1:m9yLtI
169169
github.com/gptscript-ai/broadcaster v0.0.0-20240625175512-c43682019b86/go.mod h1:lK3K5EZx4dyT24UG3yCt0wmspkYqrj4D/8kxdN3relk=
170170
github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379 h1:vYnXoIyCXzaCEw0sYifQ4bDpsv3/fO/dZ2suEsTwCIo=
171171
github.com/gptscript-ai/chat-completion-client v0.0.0-20240531200700-af8e7ecf0379/go.mod h1:7P/o6/IWa1KqsntVf68hSnLKuu3+xuqm6lYhch1w4jo=
172-
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d h1:sKf7T7twhGXs6AVbvD9pKDVewykkwSAPwEpmIEQIR/4=
173-
github.com/gptscript-ai/cmd v0.0.0-20240625175447-4250b42feb7d/go.mod h1:DJAo1xTht1LDkNYFNydVjTHd576TC7MlpsVRl3oloVw=
172+
github.com/gptscript-ai/cmd v0.0.0-20240802230653-326b7baf6fcb h1:ky2J2CzBOskC7Jgm2VJAQi2x3p7FVGa+2/PcywkFJuc=
173+
github.com/gptscript-ai/cmd v0.0.0-20240802230653-326b7baf6fcb/go.mod h1:DJAo1xTht1LDkNYFNydVjTHd576TC7MlpsVRl3oloVw=
174174
github.com/gptscript-ai/go-gptscript v0.9.4-0.20240801203434-840b14393b17 h1:BTfJ6ls31Roq42lznlZnuPzRf0wrT8jT+tWcvq7wDXY=
175175
github.com/gptscript-ai/go-gptscript v0.9.4-0.20240801203434-840b14393b17/go.mod h1:Dh6vYRAiVcyC3ElZIGzTvNF1FxtYwA07BHfSiFKQY7s=
176176
github.com/gptscript-ai/tui v0.0.0-20240802053758-038d3eed9502 h1:172DJthLtMUqXrODC/wGd0Vmj6adn9YiP9KnlrZpD+4=

pkg/cli/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package cli
22

33
import (
4+
"context"
45
"os"
6+
"os/signal"
57

68
"github.com/gptscript-ai/cmd"
79
"github.com/gptscript-ai/gptscript/pkg/daemon"
@@ -18,5 +20,7 @@ func Main() {
1820
}
1921
os.Exit(0)
2022
}
21-
cmd.Main(New())
23+
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
24+
defer cancel()
25+
cmd.MainCtx(ctx, New())
2226
}

0 commit comments

Comments
 (0)