ttyconsole.go 681 B

1234567891011121314151617181920212223242526272829303132
  1. // +build windows
  2. package windows
  3. import (
  4. "github.com/microsoft/hcsshim"
  5. )
  6. // TtyConsole implements the exec driver Terminal interface.
  7. type TtyConsole struct {
  8. id string
  9. processid uint32
  10. }
  11. // NewTtyConsole returns a new TtyConsole struct.
  12. func NewTtyConsole(id string, processid uint32) *TtyConsole {
  13. tty := &TtyConsole{
  14. id: id,
  15. processid: processid,
  16. }
  17. return tty
  18. }
  19. // Resize implements Resize method of Terminal interface.
  20. func (t *TtyConsole) Resize(h, w int) error {
  21. return hcsshim.ResizeConsoleInComputeSystem(t.id, t.processid, h, w)
  22. }
  23. // Close implements Close method of Terminal interface.
  24. func (t *TtyConsole) Close() error {
  25. return nil
  26. }