diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-06-16 15:29:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 15:29:34 -0400 |
commit | 2509a81c343314fa452a0215d05e9d74ab4ec15c (patch) | |
tree | 18252074d42b6adfa4021e89a80d6c2f399f0a34 /pkg/domain/infra | |
parent | b3f61ec38cda171caf8e8624a9ec875ba85bc20d (diff) | |
parent | 666f555aa52b9f82da9d6ca64cf11e4f5e1e78e8 (diff) | |
download | podman-2509a81c343314fa452a0215d05e9d74ab4ec15c.tar.gz podman-2509a81c343314fa452a0215d05e9d74ab4ec15c.tar.bz2 podman-2509a81c343314fa452a0215d05e9d74ab4ec15c.zip |
Merge pull request #10683 from Luap99/exec-resize
Fix resize race with podman exec -it
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r-- | pkg/domain/infra/abi/terminal/terminal_linux.go | 4 |
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) } |