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

macOS selection box is wrong intented #961

Open
KuramaSyu opened this issue Dec 23, 2024 · 1 comment
Open

macOS selection box is wrong intented #961

KuramaSyu opened this issue Dec 23, 2024 · 1 comment

Comments

@KuramaSyu
Copy link

KuramaSyu commented Dec 23, 2024

I have a small CLI tool, which does everything correctly on macos except for the weird increasing intent, like on the screenshot. I tested a bit - it's the raw mode which causes issues
image

If you need more information:
https://github.com/KuramaSyu/acnh-backup/blob/6164d117bd63a9323923af0c55411d721987c534/src/main.rs#L19-L49
this is the source code. It's 250 lines - so not big at all. The marked 30 lines should already contain everything

To Reproduce
Steps to reproduce the behavior:

  1. enter raw mode: enable_raw_mode().expect("Failed to enable raw mode");
  2. make a selection menu:
let selection = Select::with_theme(&ColorfulTheme::default())
    .with_prompt("What would you like to do?")
    .item("Backup")
    .item("Restore")
    .item("Exit")
    .interact_opt()
    .expect("Failed to get user selection");
  1. see, that it's buggy. I tested it in iterm2 and in the interated VSC terminal.

Expected behavior
A non intented selection menu

OS
macOS

Terminal/Console

  • iterm2, VSC integrated terminal - only on macos
@joshka
Copy link
Collaborator

joshka commented Dec 23, 2024

Raw mode turns off processing newlines. This is expected behavior.
See https://docs.rs/crossterm/latest/crossterm/terminal/index.html#raw-mode

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

2 participants