{"id":"b2d129c16f7fe712","repo":"docker/cli","slug":"unable-to-set-io-streams-as-raw-terminal-s","errorCode":null,"errorMessage":"unable to set IO streams as raw terminal: %s","messagePattern":"unable to set IO streams as raw terminal: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/hijack.go","lineNumber":105,"sourceCode":"\tcase err := <-detached:\n\t\t// Got a detach key sequence.\n\t\treturn err\n\tcase <-ctx.Done():\n\t\treturn ctx.Err()\n\t}\n}\n\nfunc (h *hijackedIOStreamer) setupInput() (restore func(), _ error) {\n\tif h.inputStream == nil || !h.tty {\n\t\t// No need to setup input TTY.\n\t\t// The restore func is a nop.\n\t\treturn func() {}, nil\n\t}\n\tif err := validateDetachKeys(h.detachKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := setRawTerminal(h.streams); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to set IO streams as raw terminal: %s\", err)\n\t}\n\n\t// Use sync.Once so we may call restore multiple times but ensure we\n\t// only restore the terminal once.\n\trestore = sync.OnceFunc(func() {\n\t\t_ = restoreTerminal(h.streams, h.inputStream)\n\t})\n\n\t// Wrap the input to detect detach escape sequence.\n\t// Use default escape keys if an invalid sequence is given.\n\tescapeKeys := defaultEscapeKeys\n\tif h.detachKeys != \"\" {\n\t\tvar err error\n\t\tescapeKeys, err = term.ToBytes(h.detachKeys)\n\t\tif err != nil {\n\t\t\trestore()\n\t\t\treturn nil, err\n\t\t}","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/hijack.go#L87-L123","documentation":"Error \"unable to set IO streams as raw terminal: %s\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/hijack.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}