Skip to content
Snippets Groups Projects
Commit 6c8db92f authored by Fabian Seidl's avatar Fabian Seidl
Browse files

Resolve "Exiting gosdnc causes the input in cli to be invisble"

See merge request !536
parent 6024d1f4
No related branches found
No related tags found
1 merge request!536Resolve "Exiting gosdnc causes the input in cli to be invisble"
Pipeline #160790 failed
...@@ -33,6 +33,7 @@ package cmd ...@@ -33,6 +33,7 @@ package cmd
import ( import (
"os" "os"
"os/exec"
"strings" "strings"
"code.fbi.h-da.de/danet/gosdn/cli/completer" "code.fbi.h-da.de/danet/gosdn/cli/completer"
...@@ -42,6 +43,7 @@ import ( ...@@ -42,6 +43,7 @@ import (
"github.com/openconfig/goyang/pkg/yang" "github.com/openconfig/goyang/pkg/yang"
"github.com/pterm/pterm" "github.com/pterm/pterm"
"github.com/pterm/pterm/putils" "github.com/pterm/pterm/putils"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/spf13/viper" "github.com/spf13/viper"
...@@ -386,8 +388,16 @@ var exitCmd = &cobra.Command{ ...@@ -386,8 +388,16 @@ var exitCmd = &cobra.Command{
Long: `The exit command exits the interactive prompt mode.`, Long: `The exit command exits the interactive prompt mode.`,
RunE: func(cmd *cobra.Command, args []string) error { 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 return nil
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment