2015-05-27 20:15:14 +00:00
|
|
|
// +build windows
|
|
|
|
|
|
|
|
package windows
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/microsoft/hcsshim"
|
|
|
|
)
|
|
|
|
|
2015-08-03 01:54:02 +00:00
|
|
|
// TtyConsole implements the exec driver Terminal interface.
|
2015-05-27 20:15:14 +00:00
|
|
|
type TtyConsole struct {
|
|
|
|
id string
|
|
|
|
processid uint32
|
|
|
|
}
|
|
|
|
|
2015-08-03 01:54:02 +00:00
|
|
|
// NewTtyConsole returns a new TtyConsole struct.
|
2015-05-27 20:15:14 +00:00
|
|
|
func NewTtyConsole(id string, processid uint32) *TtyConsole {
|
|
|
|
tty := &TtyConsole{
|
|
|
|
id: id,
|
|
|
|
processid: processid,
|
|
|
|
}
|
|
|
|
return tty
|
|
|
|
}
|
|
|
|
|
2015-08-03 01:54:02 +00:00
|
|
|
// Resize implements Resize method of Terminal interface.
|
2015-05-27 20:15:14 +00:00
|
|
|
func (t *TtyConsole) Resize(h, w int) error {
|
|
|
|
return hcsshim.ResizeConsoleInComputeSystem(t.id, t.processid, h, w)
|
|
|
|
}
|
|
|
|
|
2015-08-03 01:54:02 +00:00
|
|
|
// Close implements Close method of Terminal interface.
|
2015-05-27 20:15:14 +00:00
|
|
|
func (t *TtyConsole) Close() error {
|
|
|
|
return nil
|
|
|
|
}
|