Close closes all open fds for the tty and/or restores the original stdin state to what it was prior to the container execution
()
| 168 | // Close closes all open fds for the tty and/or restores the original |
| 169 | // stdin state to what it was prior to the container execution |
| 170 | func (t *tty) Close() { |
| 171 | // ensure that our side of the fds are always closed |
| 172 | for _, c := range t.postStart { |
| 173 | _ = c.Close() |
| 174 | } |
| 175 | // the process is gone at this point, shutting down the console if we have |
| 176 | // one and wait for all IO to be finished |
| 177 | if t.console != nil && t.epoller != nil { |
| 178 | _ = t.console.Shutdown(t.epoller.CloseConsole) |
| 179 | } |
| 180 | t.wg.Wait() |
| 181 | for _, c := range t.closers { |
| 182 | _ = c.Close() |
| 183 | } |
| 184 | if t.hostConsole != nil { |
| 185 | _ = t.hostConsole.Reset() |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | func (t *tty) resize() error { |
| 190 | if t.console == nil || t.hostConsole == nil { |