Skip to content

Commit

Permalink
fix: Prevent Ctrl+C from exiting remote shell (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousLearner authored Aug 28, 2024
1 parent d99e82a commit b1c030b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [4.5.1] - [TBD]

### Fixed

* Prevent `Ctrl+C` from exiting the remote shell session prematurely.

### Changed

* Limits the number of custom domains to 4.
Expand Down
8 changes: 7 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -649,7 +651,11 @@ func (a *App) ConnectToEcsSession(ecsSession *ecs.Session) error {
*region,
"StartSession",
}

// Ignore Ctrl+C to keep the session active;
// reset the signal afterward so the main function
// can handle interrupts during the rest of the program's execution.
signal.Ignore(syscall.SIGINT)
defer signal.Reset(syscall.SIGINT)
sessionManagerPluginSession.ValidateInputAndStartSession(args, os.Stdout)
return nil
}
Expand Down

0 comments on commit b1c030b

Please sign in to comment.