forked from Silverfish/proton-bridge
feat(GODT-2611): bridge CLI exits on the first SIGINT / Ctrl+C.
This commit is contained in:
@ -20,6 +20,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/ProtonMail/gluon/async"
|
"github.com/ProtonMail/gluon/async"
|
||||||
"github.com/ProtonMail/proton-bridge/v3/internal/bridge"
|
"github.com/ProtonMail/proton-bridge/v3/internal/bridge"
|
||||||
@ -60,6 +61,11 @@ func New(
|
|||||||
panicHandler: panicHandler,
|
panicHandler: panicHandler,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We want to exit at the first Ctrl+C. By default, ishell requires two.
|
||||||
|
fe.Interrupt(func(_ *ishell.Context, _ int, _ string) {
|
||||||
|
os.Exit(1)
|
||||||
|
})
|
||||||
|
|
||||||
// Clear commands.
|
// Clear commands.
|
||||||
clearCmd := &ishell.Cmd{
|
clearCmd := &ishell.Cmd{
|
||||||
Name: "clear",
|
Name: "clear",
|
||||||
|
|||||||
Reference in New Issue
Block a user