feat(GODT-2611): bridge CLI exits on the first SIGINT / Ctrl+C.

This commit is contained in:
Xavier Michelon
2023-05-04 11:48:05 +02:00
parent fdae8cb729
commit bd47303074

View File

@ -20,6 +20,7 @@ package cli
import (
"errors"
"os"
"github.com/ProtonMail/gluon/async"
"github.com/ProtonMail/proton-bridge/v3/internal/bridge"
@ -60,6 +61,11 @@ func New(
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.
clearCmd := &ishell.Cmd{
Name: "clear",