mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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:
parent
ed8466c44c
commit
de848a14ca
2 changed files with 4 additions and 4 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dotcloud/docker/execdriver"
|
"github.com/dotcloud/docker/execdriver"
|
||||||
"github.com/dotcloud/docker/pkg/cgroups"
|
"github.com/dotcloud/docker/pkg/cgroups"
|
||||||
|
"github.com/dotcloud/docker/pkg/term"
|
||||||
"github.com/dotcloud/docker/utils"
|
"github.com/dotcloud/docker/utils"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"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) {
|
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
|
return -1, err
|
||||||
}
|
}
|
||||||
configPath, err := d.generateLXCConfig(c)
|
configPath, err := d.generateLXCConfig(c)
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package lxc
|
package term
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/dotcloud/docker/execdriver"
|
"github.com/dotcloud/docker/execdriver"
|
||||||
"github.com/dotcloud/docker/pkg/term"
|
|
||||||
"github.com/kr/pty"
|
"github.com/kr/pty"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
@ -51,7 +50,7 @@ func (t *TtyConsole) Master() *os.File {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TtyConsole) Resize(h, w int) error {
|
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 {
|
func (t *TtyConsole) attach(command *execdriver.Command, pipes *execdriver.Pipes) error {
|
Loading…
Add table
Add a link
Reference in a new issue