mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
seperate out the terminal functions from lxc to the pkg/term
Since these functions are indepenent of lxc, and could be used by other drivers. Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/dotcloud/docker/execdriver"
|
||||
"github.com/dotcloud/docker/pkg/cgroups"
|
||||
"github.com/dotcloud/docker/pkg/term"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -77,7 +78,7 @@ func (d *driver) Name() string {
|
||||
}
|
||||
|
||||
func (d *driver) Run(c *execdriver.Command, pipes *execdriver.Pipes, startCallback execdriver.StartCallback) (int, error) {
|
||||
if err := SetTerminal(c, pipes); err != nil {
|
||||
if err := term.SetTerminal(c, pipes); err != nil {
|
||||
return -1, err
|
||||
}
|
||||
configPath, err := d.generateLXCConfig(c)
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package lxc
|
||||
package term
|
||||
|
||||
import (
|
||||
"github.com/dotcloud/docker/execdriver"
|
||||
"github.com/dotcloud/docker/pkg/term"
|
||||
"github.com/kr/pty"
|
||||
"io"
|
||||
"os"
|
||||
@@ -51,7 +50,7 @@ func (t *TtyConsole) Master() *os.File {
|
||||
}
|
||||
|
||||
func (t *TtyConsole) Resize(h, w int) error {
|
||||
return term.SetWinsize(t.master.Fd(), &term.Winsize{Height: uint16(h), Width: uint16(w)})
|
||||
return SetWinsize(t.master.Fd(), &Winsize{Height: uint16(h), Width: uint16(w)})
|
||||
}
|
||||
|
||||
func (t *TtyConsole) attach(command *execdriver.Command, pipes *execdriver.Pipes) error {
|
||||
Reference in New Issue
Block a user