2014-08-01 00:53:22 +04:00
|
|
|
package daemon
|
|
|
|
|
2015-07-31 00:01:53 +03:00
|
|
|
// ContainerResize changes the size of the TTY of the process running
|
|
|
|
// in the container with the given name to the given height and width.
|
2015-09-29 20:51:40 +03:00
|
|
|
func (daemon *Daemon) ContainerResize(name string, height, width int) error {
|
|
|
|
container, err := daemon.Get(name)
|
2014-09-16 02:56:47 +04:00
|
|
|
if err != nil {
|
2015-03-25 10:44:12 +03:00
|
|
|
return err
|
2014-09-16 02:56:47 +04:00
|
|
|
}
|
2015-05-02 04:03:35 +03:00
|
|
|
|
2015-09-29 20:51:40 +03:00
|
|
|
return container.Resize(height, width)
|
2015-05-02 04:03:35 +03:00
|
|
|
}
|
|
|
|
|
2015-07-31 00:01:53 +03:00
|
|
|
// ContainerExecResize changes the size of the TTY of the process
|
|
|
|
// running in the exec with the given name to the given height and
|
|
|
|
// width.
|
2015-09-29 20:51:40 +03:00
|
|
|
func (daemon *Daemon) ContainerExecResize(name string, height, width int) error {
|
2015-07-31 00:01:53 +03:00
|
|
|
ExecConfig, err := daemon.getExecConfig(name)
|
2015-05-02 04:03:35 +03:00
|
|
|
if err != nil {
|
2015-03-25 10:44:12 +03:00
|
|
|
return err
|
2014-09-16 02:56:47 +04:00
|
|
|
}
|
2015-05-02 04:03:35 +03:00
|
|
|
|
2015-07-31 00:01:53 +03:00
|
|
|
return ExecConfig.resize(height, width)
|
2014-09-16 02:56:47 +04:00
|
|
|
}
|