Skip to content

Commit 4fa3d70

Browse files
committed
make SaneTerminal public
similar to opencontainers/runc#1479, we want to use this for console's consumer so they dont have to create their own implementation. Signed-off-by: Daniel Dao <[email protected]>
1 parent adfddd2 commit 4fa3d70

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

console_unix.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,12 @@ func newMaster(f *os.File) Console {
136136
f: f,
137137
}
138138
}
139+
140+
// SaneTerminal sets the necessary tty_ioctl(4)s to ensure that a pty pair
141+
// created by us acts normally. In particular, a not-very-well-known default of
142+
// Linux unix98 ptys is that they have +onlcr by default. While this isn't a
143+
// problem for terminal emulators, because we relay data from the terminal we
144+
// also relay that funky line discipline.
145+
func SaneTerminal(f *os.File) error {
146+
return saneTerminal(f)
147+
}

0 commit comments

Comments
 (0)