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 Big Sur shell and tty strange behaviors with inputs #5023

Closed
moutoum opened this issue Apr 29, 2021 · 13 comments
Closed

MacOS Big Sur shell and tty strange behaviors with inputs #5023

moutoum opened this issue Apr 29, 2021 · 13 comments

Comments

@moutoum
Copy link

moutoum commented Apr 29, 2021

System

OS: MacOS BigSur 11.3
Version: alacritty 0.7.2 (5ac8060)

Description

I have an issue with my alacritty when I'm using a new shell session. I can start the session, but then, some inputs are behaving in a strange way while in normal mode it's working well. For example, if I try to type a {, in some tty it's not working at all, and in other, it displays the current directory content in formatted way :

// With docker exec
$ docker exec -it <cont> /bin/bash
... $ <typing '{'>
... $ {.{d{bshell,ockerenv},mongorc.js},b{i{n,tnami},oot},d{ev,ocker-entrypoint-initdb.d},etc,home,lib{,64},m{edia,nt},opt,proc,r{oot,un},s{bin,rv,ys},tmp,usr,var}

// Opening new shell session
$ /bin/bash
... $ <typing '{'>
... $ {.{d{bshell,ockerenv},mongorc.js},b{i{n,tnami},oot},d{ev,ocker-entrypoint-initdb.d},etc,home,lib{,64},m{edia,nt},opt,proc,r{oot,un},s{bin,rv,ys},tmp,usr,var}

In my Alacritty env, TERM=alacritty.

I tried to use these commands in an other terminal emulator (default MacOS one) and it works well, the inputs are corrects.

Do not hesitate to ask me for more details if you need to.
Thanks

@chrisduerr
Copy link
Member

Sounds like an issue with your macOS setup. I'd recommend looking into keyboard layout, potentially configured global shortcuts and the output of the locale command.

@moutoum
Copy link
Author

moutoum commented Apr 29, 2021

I tried to use different keyboard layouts but same issue on this character. What do I have to do with the locale command ?
The current output is:

LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Also I don't understand because in the default shell open by Alacritty, the keys are working perfectly..

@chrisduerr
Copy link
Member

Try setting the locale to en_US.UTF-8.

@moutoum
Copy link
Author

moutoum commented Apr 30, 2021

I can try but the locale command output is the same for both terminals... I'm not sure setting the locale will change something, but maybe I'm wrong, I don't really know how it works under the hood.

In the default term

$ locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

in the sub-term (/bin/bash):

bash-3.2$ locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Also, this is the locale output from a working terminal emulator (Terminal.app):

$ locale
LANG=""
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

EDIT: I tried to run alacritty with the print-events flag and I found this in the logs:

021-04-30 13:25:20.889520000] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(Id(140691003961760)), event: KeyboardInput { device_id: DeviceId(DeviceId), input: KeyboardInput { scancode: 23, state: Pressed, virtual_keycode: Some(LBracket), modifiers: ALT }, is_synthetic: false } }
[2021-04-30 13:25:20.889730000] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(Id(140691003961760)), event: ReceivedCharacter('{') }

EDIT 2: I also tried to change the locale using the LC_ALL env variable and run shell using the --login flag in the alacritty configuration file but still not working..

env:
        LC_ALL: en_US.UTF-8

shell:
        program: /usr/local/bin/fish
        args:
                - --login

@chrisduerr
Copy link
Member

Also I don't understand because in the default shell open by Alacritty, the keys are working perfectly.

If this works just fine, I'd assume zsh is your default shell? Have you tried changing your shell to fish to see if everything works in Alacritty then?

@moutoum
Copy link
Author

moutoum commented May 3, 2021

My default shell is fish actually, I tried to set the shell used by alacritty to zsh and bash but the keys are not working as expected also...

@chrisduerr
Copy link
Member

Well then try with your default shell set to zsh.

@moutoum
Copy link
Author

moutoum commented May 3, 2021

Nothing to do, same issue, I do not manage to make the keys working as expected...
I did:

  • chsh -s /bin/zsh
  • removing the shell param from alacritty config file
  • restarted alacritty
  • tried using '{'

So I rolled back to fish.. I fact, it seems only fish is working. I can open a sub-fish shell session and it works, but any other shells are not working with my alacritty..

@chrisduerr
Copy link
Member

So launching zsh inside of fish also doesn't work?

@moutoum
Copy link
Author

moutoum commented May 3, 2021

Exactly, only fish inside fish works. All the other combinations except fish and fish inside fish are not working.

  • bash
  • bash inside fish
  • zsh
  • zsh inside fish
  • bash inside ssh inside fish
  • bash inside docker container

I can start them, bit when I want to use some keys like '{', I have several behaviors (nothing, directory listing...) in alacritty. Those combinations seem to be working well with the default Terminal.app included with MacOS.

Infos: my Mac is configured with French keyboard layout, and I'm using an AZERTY keyboard.

@chrisduerr
Copy link
Member

Does it work with qwerty? Probably a duplicate of #458.

@moutoum
Copy link
Author

moutoum commented May 3, 2021

Yes it works with Qwerty layout, so it seems to be a duplicated issue

@chrisduerr
Copy link
Member

It seems somewhat strange that it would cause the behavior you've described, but I doubt there's any issue in Alacritty besides the qwerty layout one. Hopefully once that is finally resolved things will either work properly or at least help troubleshoot this issue further.

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

No branches or pull requests

2 participants