Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 5ec5e2f

Browse files
authored
Merge pull request #469 from gnawux/reset_tty
reset container tty after container stopped
2 parents 4a970c7 + 22c5093 commit 5ec5e2f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hypervisor/context.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,15 @@ func (ctx *VmContext) handleProcessAsyncEvent(pae *hyperstartapi.ProcessAsyncEve
244244
ctx.reportProcessFinished(types.E_CONTAINER_FINISHED, &types.ProcessFinished{
245245
Id: pae.Container, Code: uint8(pae.Status), Ack: make(chan bool, 1),
246246
})
247+
ctx.lock.Lock()
248+
if c, ok := ctx.containers[pae.Container]; ok {
249+
c.Log(TRACE, "container finished, unset iostream pipes")
250+
c.stdinPipe = nil
251+
c.stdoutPipe = nil
252+
c.stderrPipe = nil
253+
c.tty = nil
254+
}
255+
ctx.lock.Unlock()
247256
} else {
248257
ctx.DeleteExec(pae.Process)
249258
ctx.reportProcessFinished(types.E_EXEC_FINISHED, &types.ProcessFinished{

0 commit comments

Comments
 (0)