Skip to content

Commit

Permalink
RSDK-4377 Set raw and -echo for CLI shell service (#2756)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjirewis authored Aug 8, 2023
1 parent 1fcf031 commit 9141766
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,15 @@ func (c *AppClient) StartRobotPartShell(
}

setRaw := func(isRaw bool) error {
r := "raw"
// NOTE(benjirewis): Linux systems seem to need both "raw" (no processing) and "-echo"
// (no echoing back inputted characters) in order to allow the input and output loops
// below to completely control the terminal.
args := []string{"raw", "-echo"}
if !isRaw {
r = "-raw"
args = []string{"-raw", "echo"}
}

rawMode := exec.Command("stty", r)
rawMode := exec.Command("stty", args...)
rawMode.Stdin = os.Stdin
return rawMode.Run()
}
Expand Down

0 comments on commit 9141766

Please sign in to comment.