Skip to content

Commit f364c1a

Browse files
committed
Set ClearONLCR in tests
Signed-off-by: Michael Crosby <[email protected]>
1 parent 9ba16b6 commit f364c1a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

contrib/cmd/recvtty/recvtty.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,25 +101,26 @@ func handleSingle(path string) error {
101101
if err != nil {
102102
return err
103103
}
104-
console, err := console.ConsoleFromFile(master)
104+
c, err := console.ConsoleFromFile(master)
105105
if err != nil {
106106
return err
107107
}
108+
console.ClearONLCR(c.Fd())
108109

109110
// Copy from our stdio to the master fd.
110111
quitChan := make(chan struct{})
111112
go func() {
112-
io.Copy(os.Stdout, console)
113+
io.Copy(os.Stdout, c)
113114
quitChan <- struct{}{}
114115
}()
115116
go func() {
116-
io.Copy(console, os.Stdin)
117+
io.Copy(c, os.Stdin)
117118
quitChan <- struct{}{}
118119
}()
119120

120121
// Only close the master fd once we've stopped copying.
121122
<-quitChan
122-
console.Close()
123+
c.Close()
123124
return nil
124125
}
125126

libcontainer/integration/execin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func TestExecInTTY(t *testing.T) {
309309
}
310310
return
311311
}
312-
console.SaneTerminal(f)
312+
console.ClearONLCR(c.Fd())
313313
dc <- &cdata{
314314
c: c,
315315
}

tty.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func (t *tty) recvtty(process *libcontainer.Process, socket *os.File) error {
8080
if err != nil {
8181
return err
8282
}
83+
console.ClearONLCR(cons.Fd())
8384
epoller, err := console.NewEpoller()
8485
if err != nil {
8586
return err

0 commit comments

Comments
 (0)