mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 19:36:22 +00:00
Merge pull request #25273 from ncdc/exec-sigwinch
Automatic merge from submit-queue Support terminal resizing for exec/attach/run ```release-note Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions inherit the environment from the primary process, so if the container was created with tty=false, that means the exec session's TERM variable will default to "dumb". Users can override this by setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior. ``` Fixes #13585
This commit is contained in:
@@ -17,14 +17,15 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"k8s.io/kubernetes/pkg/kubectl/cmd"
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
)
|
||||
|
||||
func NewKubectlServer() *Server {
|
||||
cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr)
|
||||
// need to use term.StdStreams to get the right IO refs on Windows
|
||||
stdin, stdout, stderr := term.StdStreams()
|
||||
cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), stdin, stdout, stderr)
|
||||
localFlags := cmd.LocalFlags()
|
||||
localFlags.SetInterspersed(false)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package app
|
||||
|
||||
import (
|
||||
"os"
|
||||
"github.com/docker/docker/pkg/term"
|
||||
|
||||
"k8s.io/kubernetes/pkg/kubectl/cmd"
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
@@ -28,6 +28,8 @@ WARNING: this logic is duplicated, with minor changes, in cmd/hyperkube/kubectl.
|
||||
Any salient changes here will need to be manually reflected in that file.
|
||||
*/
|
||||
func Run() error {
|
||||
cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr)
|
||||
// need to use term.StdStreams to get the right IO refs on Windows
|
||||
stdin, stdout, stderr := term.StdStreams()
|
||||
cmd := cmd.NewKubectlCommand(cmdutil.NewFactory(nil), stdin, stdout, stderr)
|
||||
return cmd.Execute()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user