Skip to content
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

Hyperkit's go api could not create console on stdio. #325

Open
hotgake opened this issue Dec 2, 2021 · 0 comments
Open

Hyperkit's go api could not create console on stdio. #325

hotgake opened this issue Dec 2, 2021 · 0 comments

Comments

@hotgake
Copy link

hotgake commented Dec 2, 2021

Could not create console on stdio with ConsoleStdio or StdioInteractiveConsole

Case 1. StdioInteractiveConsole

If I set the value of Serial.InteractiveConsole to StdioInteractiveConsole to create console on stdio, it return an error:
If StdioInteractiveConsole is set, stdio must be a TTY.

Unlike the description of the error, this error occurs when isTerminal() condition returns true. That is, although stdio is a tty, error occurs.

if isTerminal(os.Stdout) {
  return errors.New("If StdioInteractiveConsole is set, stdio must be a TTY")
}

Case 2. ConsoleStdio

If I set the value of Hyperkit.Console (without Serial) field to ConsoleStdio and call run(), an error occurs: exec: Stdout already set.

With stdio console, cmd.Stdout is set to os.Stdout (cmd.Stdout = os.Stdout). But the next line, cmd.StdoutPipe() method is called and the method return error when cmd.Stdout is not nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant