-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix nerdctl exec init console size 0 0 problem #2182
Conversation
pkg/cmd/container/exec.go
Outdated
@@ -181,3 +184,11 @@ func generateExecProcessSpec(ctx context.Context, client *containerd.Client, con | |||
|
|||
return pspec, nil | |||
} | |||
|
|||
func setInitialTTYSize(pspec *specs.Process) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a function works more like specs.Process' decorator, so it's not so proper to go to consoleutil
pkg/cmd/container/exec.go
Outdated
func setInitialTTYSize(pspec *specs.Process) { | ||
size, err := console.Current().Size() | ||
if err != nil { | ||
size.Height, size.Width = 0, 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why override with 0, 0
values ?
may be
size, err := console.Current().Size()
if err == nil {
pspec.ConsoleSize = &specs.Box{Height: uint(size.Height), Width: uint(size.Width)}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's right, I've change codes now
would you please squash your commits, you can ping me if you need some help. Thanks |
Signed-off-by: ChangJH-Mark <1431293514@qq.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
currently
nerdctl exec -it
initial tty size is0 0
, switch it to current console size