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