Skip to content

Commit

Permalink
Fixed CTRL+C behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodangelis committed Apr 19, 2021
2 parents 017defe + b510e15 commit 581e917
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func receiveCmdFunc(command *cobra.Command, args []string) error {
}()
go func() {
for {
char, _, _ := keyboard.GetKey()
if string(char) == "q" {
char, key, _ := keyboard.GetKey()
if string(char) == "q" || key == keyboard.KeyCtrlC {
srv.Shutdown()
}
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ func sendCmdFunc(command *cobra.Command, args []string) error {
}()
go func() {
for {
char, _, _ := keyboard.GetKey()
if string(char) == "q" {
char, key, _ := keyboard.GetKey()
if string(char) == "q" || key == keyboard.KeyCtrlC {
srv.Shutdown()
}
}
Expand Down

0 comments on commit 581e917

Please sign in to comment.