Copy io into and out of console

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-08-22 14:04:17 -04:00
parent 07e2b63d69
commit 4f644dbfd5
4 changed files with 26 additions and 26 deletions

View File

@@ -65,13 +65,21 @@ var startCommand = cli.Command{
if err != nil {
return err
}
var (
tty = spec.Process.Terminal
opts = getNewTaskOpts(context)
ioOpts = []cio.Opt{cio.WithFIFODir(context.String("fifo-dir"))}
)
task, err := NewTask(ctx, client, container, "", tty, context.Bool("null-io"), ioOpts, opts...)
var con console.Console
if tty {
con = console.Current()
defer con.Reset()
if err := con.SetRaw(); err != nil {
return err
}
}
task, err := NewTask(ctx, client, container, "", con, context.Bool("null-io"), ioOpts, opts...)
if err != nil {
return err
}
@@ -86,14 +94,6 @@ var startCommand = cli.Command{
return err
}
var con console.Console
if tty {
con = console.Current()
defer con.Reset()
if err := con.SetRaw(); err != nil {
return err
}
}
if err := task.Start(ctx); err != nil {
return err
}