From f364c1a58c90d98377db130660a19a61a923832a Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Mon, 25 Sep 2017 13:23:56 -0400 Subject: [PATCH] Set ClearONLCR in tests Signed-off-by: Michael Crosby --- contrib/cmd/recvtty/recvtty.go | 9 +++++---- libcontainer/integration/execin_test.go | 2 +- tty.go | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/contrib/cmd/recvtty/recvtty.go b/contrib/cmd/recvtty/recvtty.go index 95d68dab08b..a658b8d2020 100644 --- a/contrib/cmd/recvtty/recvtty.go +++ b/contrib/cmd/recvtty/recvtty.go @@ -101,25 +101,26 @@ func handleSingle(path string) error { if err != nil { return err } - console, err := console.ConsoleFromFile(master) + c, err := console.ConsoleFromFile(master) if err != nil { return err } + console.ClearONLCR(c.Fd()) // Copy from our stdio to the master fd. quitChan := make(chan struct{}) go func() { - io.Copy(os.Stdout, console) + io.Copy(os.Stdout, c) quitChan <- struct{}{} }() go func() { - io.Copy(console, os.Stdin) + io.Copy(c, os.Stdin) quitChan <- struct{}{} }() // Only close the master fd once we've stopped copying. <-quitChan - console.Close() + c.Close() return nil } diff --git a/libcontainer/integration/execin_test.go b/libcontainer/integration/execin_test.go index 945e6099441..8ef19947797 100644 --- a/libcontainer/integration/execin_test.go +++ b/libcontainer/integration/execin_test.go @@ -309,7 +309,7 @@ func TestExecInTTY(t *testing.T) { } return } - console.SaneTerminal(f) + console.ClearONLCR(c.Fd()) dc <- &cdata{ c: c, } diff --git a/tty.go b/tty.go index 940df844fd0..c8d01ebe319 100644 --- a/tty.go +++ b/tty.go @@ -80,6 +80,7 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error { if err != nil { return err } + console.ClearONLCR(cons.Fd()) epoller, err := console.NewEpoller() if err != nil { return err