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't use @ when using Swedish keyboard in Windows #1319

Open
matheusfenolio opened this issue Feb 9, 2025 · 4 comments
Open

Can't use @ when using Swedish keyboard in Windows #1319

matheusfenolio opened this issue Feb 9, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@matheusfenolio
Copy link

Describe the bug
Character @ does not show up in huh.Input when typing, or copying and past using Swedish keyboard

To Reproduce
Steps to reproduce the behavior:

  1. Create a new form
package main

import "github.com/charmbracelet/huh"

func main() {
	email := ""

	huh.NewForm(
		huh.NewGroup(
			huh.NewInput().
				Title("email").
				Value(&email),
		),
	).Run()
}
  1. Add the Swedish keyboard using the English US
  2. Run go run main.go
  3. Type altGr + 2

Expected behavior
The character @ to appear in the input

Screenshots

Image

Image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Firefox
  • Version (OS build): 22631.4602

Additional context

  • Works fine with any other keyboard type.
  • I notice that sometimes it works fine, but it's very rare.
  • Other symbols works just fine
@matheusfenolio matheusfenolio changed the title Can't use @ when using Swedish keyboard in Windows [BUG?] Can't use @ when using Swedish keyboard in Windows Feb 9, 2025
@matheusfenolio
Copy link
Author

I did some further debugging and seems that the issue is with bubbles. I put a break point here, and I saw that the rune code is wrong. I was supposed to be 64 (US Keyboard), but was 0 (Using Swedish keyboard).

I see that the string passed through tea.Msg is actually alt+ctrl+@

Image

@meowgorithm
Copy link
Member

Thanks for the thorough report! This looks like it's happening in Bubble Tea (likely /x/input, where input in processed); transferring accordingly.

@meowgorithm meowgorithm transferred this issue from charmbracelet/huh Feb 10, 2025
@meowgorithm meowgorithm changed the title [BUG?] Can't use @ when using Swedish keyboard in Windows Can't use @ when using Swedish keyboard in Windows Feb 10, 2025
@meowgorithm meowgorithm added the bug Something isn't working label Feb 10, 2025
@aymanbagabas
Copy link
Member

This probably predates #1162 which is in v1.3.2. Could you try bumping Bubble Tea to the latest in your project? go get github.com/charmbracelet/bubbletea@latest

We're going to update Huh to use the latest Bubble Tea soon, but meanwhile, you can bump Bubble Tea to the latest version and see if it makes a difference.

@matheusfenolio
Copy link
Author

Yes, that definitely fixed it! Thanks for the amazing, and fast support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants