summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-06-15 11:05:00 +0200
committerMatthew Heon <mheon@redhat.com>2021-06-24 13:48:48 -0400
commit6ba9617be69fe5c525b62db0af55d72205f8e5a1 (patch)
tree7a380d425aaa4c24d467faed0a879a9529d304b6 /pkg/domain/infra/abi
parenteb6d4b0cfe385a1d1f2b8cd2b90acb3ae2145ef7 (diff)
downloadpodman-6ba9617be69fe5c525b62db0af55d72205f8e5a1.tar.gz
podman-6ba9617be69fe5c525b62db0af55d72205f8e5a1.tar.bz2
podman-6ba9617be69fe5c525b62db0af55d72205f8e5a1.zip
Fix resize race with podman exec -it
When starting a process with `podman exec -it` the terminal is resized after the process is started. To fix this allow exec start to accept the terminal height and width as parameter and let it resize right before the process is started. Fixes #10560 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r--pkg/domain/infra/abi/terminal/terminal_linux.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/terminal/terminal_linux.go b/pkg/domain/infra/abi/terminal/terminal_linux.go
index ab71f8f6f..09c0f802d 100644
--- a/pkg/domain/infra/abi/terminal/terminal_linux.go
+++ b/pkg/domain/infra/abi/terminal/terminal_linux.go
@@ -15,12 +15,13 @@ import (
// ExecAttachCtr execs and attaches to a container
func ExecAttachCtr(ctx context.Context, ctr *libpod.Container, execConfig *libpod.ExecConfig, streams *define.AttachStreams) (int, error) {
- resize := make(chan define.TerminalSize)
+ var resize chan define.TerminalSize
haveTerminal := terminal.IsTerminal(int(os.Stdin.Fd()))
// Check if we are attached to a terminal. If we are, generate resize
// events, and set the terminal to raw mode
if haveTerminal && execConfig.Terminal {
+ resize = make(chan define.TerminalSize)
cancel, oldTermState, err := handleTerminalAttach(ctx, resize)
if err != nil {
return -1, err
@@ -32,7 +33,6 @@ func ExecAttachCtr(ctx context.Context, ctr *libpod.Container, execConfig *libpo
}
}()
}
-
return ctr.Exec(execConfig, streams, resize)
}