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

Can not display option and select option when run azd init by GoLand #4311

Open
rujche opened this issue Sep 12, 2024 · 5 comments
Open

Can not display option and select option when run azd init by GoLand #4311

rujche opened this issue Sep 12, 2024 · 5 comments
Assignees
Milestone

Comments

@rujche
Copy link
Member

rujche commented Sep 12, 2024

Describe the problem
Can not display option and select option when run by GoLand

To Reproduce

  1. Use GoLand to open current project.
  2. Run cli/azd/main.go by GoLand.
  3. It outputs Initializing an app to run on Azure (azd init) How do you want to initialize your app? , but no option displayed.

image

Expected behavior
Options displayed and can be selected.

Environment
Information on your environment:

  • Language name and version: go version go1.23.1 windows/amd64
  • IDE and version: GoLand 2024.2.1.1
  • Device information:

image

  • Go Settings in GoLand:

image
image
image
image

@weikanglim
Copy link
Contributor

@rujche I haven't looked into how the goland terminal is implemented, but the auto-TTY detection behavior isn't working as expected.

With #4318, we'll give you the ability to specify AZD_FORCE_TTY=true to ignore the terminal detection logic. The private build should be available for you to test soon. I'll reply back when that's available.

If you have spare time and would love to help us, you can run the code snippet from the library we're using to investigate why the terminal detection logic isn't working as expected -- and what we may want to contribute upstream (issue or code) to fix this behavior.

package main

import (
	"fmt"
	"github.com/mattn/go-isatty"
	"os"
)

func main() {
	if isatty.IsTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Terminal")
	} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
		fmt.Println("Is Cygwin/MSYS2 Terminal")
	} else {
		fmt.Println("Is Not Terminal")
	}
}

@weikanglim weikanglim self-assigned this Sep 16, 2024
@weikanglim weikanglim added this to the On Deck milestone Sep 16, 2024
@weikanglim
Copy link
Contributor

@rujche Feel free to install a private build and set AZD_FORCE_TTY=true to get it working in the Goland terminal.

@rujche
Copy link
Member Author

rujche commented Sep 18, 2024

Hi, @weikanglim

Thanks for the reply.
I tried the code above here is the result:

Is Not Terminal

Here is the related screenshot:
image

@rujche
Copy link
Member Author

rujche commented Sep 18, 2024

@rujche Feel free to install a private build and set AZD_FORCE_TTY=true to get it working in the Goland terminal.

Hi, @weikanglim After adding the changed in your PR, it returns the new error:

image

@weikanglim
Copy link
Contributor

After adding the changed in your PR, it returns the new error:

It looks like AZD_FORCE_TTY is taking effect, but you may hitting this issue in the survey library we're using in the terminal environment. Perhaps under the covers GoLand Terminal is using a MingW64 bash-for-windows-like variant. Unfortunately, fixing this would likely be along the times of a feature request along the lines of changing our UI library. I wish I had better news here...

Once thing that could help -- there's a new beta GoLand terminal that you could try here. I'm not sure if they changed things underneath that could fix the experience here.

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

No branches or pull requests

2 participants