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

Unable to change selection of a Select in certain terminals. #271

Open
simon-wh opened this issue Aug 11, 2023 · 0 comments
Open

Unable to change selection of a Select in certain terminals. #271

simon-wh opened this issue Aug 11, 2023 · 0 comments

Comments

@simon-wh
Copy link

simon-wh commented Aug 11, 2023

I have a bit of a weird issue that I'm not sure how to approach. I started using dialoguer for some simple CLI Selects for a small CLI tool.
The code I use is very close to the examples:

  let choice = Select::with_theme(&ColorfulTheme::default())
                .with_prompt("Pick a device, any device")
                .default(0)
                .items(devices.iter().as_slice())
                .interact_opt()
                .unwrap();

However, it works as expected in some terminals and not others. When it doesn't work, I'll try and navigate, the prompt flickers (indicating a re-render) but the selection doesn't actually change.

What works:

  • Warp
  • Visual Studio Code integrated terminal

What doesn't work:

  • iTerm2
  • Visual Studio Code for Web integrated terminal (vscode.dev)

It failing on VSCode for Web would kinda be fair enough, as it's not your standard terminal set-up. But I was quite confused why iTerm2 wasn't working properly

It's a little bit annoying as it means I have to have an additional terminal open on the side just for running certain commands.

Any assistance on this would be appreciated

Aside: I switched to dialoguer from youchoose to improve Windows compatibility for my tool. For what it's worth, I never had this issue with it

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