We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 881c68f + bf2eea3 commit ae922ecCopy full SHA for ae922ec
cli/command/container/hijack.go
@@ -84,12 +84,9 @@ func (h *hijackedIOStreamer) setupInput() (restore func(), err error) {
84
85
// Use sync.Once so we may call restore multiple times but ensure we
86
// only restore the terminal once.
87
- var restoreOnce sync.Once
88
- restore = func() {
89
- restoreOnce.Do(func() {
90
- _ = restoreTerminal(h.streams, h.inputStream)
91
- })
92
- }
+ restore = sync.OnceFunc(func() {
+ _ = restoreTerminal(h.streams, h.inputStream)
+ })
93
94
// Wrap the input to detect detach escape sequence.
95
// Use default escape keys if an invalid sequence is given.
0 commit comments