diff --git a/cli/cmd/prompt.go b/cli/cmd/prompt.go index 97f05b90645109cdbf1d585bf0e51624c7b485c4..af3559c09c67231d811752be1a201b3714e908e3 100644 --- a/cli/cmd/prompt.go +++ b/cli/cmd/prompt.go @@ -33,6 +33,7 @@ package cmd import ( "os" + "os/exec" "strings" "code.fbi.h-da.de/danet/gosdn/cli/completer" @@ -42,6 +43,7 @@ import ( "github.com/openconfig/goyang/pkg/yang" "github.com/pterm/pterm" "github.com/pterm/pterm/putils" + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" @@ -386,8 +388,16 @@ var exitCmd = &cobra.Command{ Long: `The exit command exits the interactive prompt mode.`, RunE: func(cmd *cobra.Command, args []string) error { - os.Exit(0) + rawModeOff := exec.Command("/bin/stty", "-raw", "echo") + rawModeOff.Stdin = os.Stdin + err := rawModeOff.Run() + if err != nil { + logrus.Error(err) + os.Exit(1) + } + + os.Exit(0) return nil }, }