nordtheme / alacritty

An arctic, north-bluish clean and elegant Alacritty color scheme.
https://www.nordtheme.com/ports/alacritty
MIT License
482 stars 59 forks source link

Terminal Bell Focuses Terminal Window #16

Closed ghost closed 3 years ago

ghost commented 3 years ago

So I found that this theme does this to me. I have two questions:

OS: Fedora 33 Shell: ZSH Alacritty: 0.8.0-dev

arcticicestudio commented 3 years ago

Hi @fmlatghor :wave:

This theme only defines colors but no code at all. It makes use of the theming API provided by Alacritty to create themes via YAML definitions. The described behavior sounds like this is either a bug in Alacritty, but more like this is a desired effect that could be customized via configurations.

ghost commented 3 years ago

Hi @fmlatghor wave

This theme only defines colors but no code at all. It makes use of the theming API provided by Alacritty to create themes via YAML definitions. The described behavior sounds like this is either a bug in Alacritty, but more like this is a desired effect that could be customized via configurations.

This happens exactly when I use this theme and only this theme, I don't really know what to tell you.

ghost commented 3 years ago

I could try again to see if it happens, but eh, it might not change anything.

arcticicestudio commented 3 years ago

Are you sure that it actually really requests the OS to set the active window to Alacritty or is it just the visual perception? It might be that you think that it takes focus, but in fact it simply uses the dim colors defined by the theme, including the dimmed foreground color. As soon as the terminal window actually gets the focus again, or any process sends a signal to the terminal that implies a activation, the normal colors are rendered by Alacritty.

The dim color were introduced in #12 with a preview of the visual style added as comment.

Normal

Dimmed

Could you also please post some details about your system, like the OS, to make it easier to identify the problem.

ghost commented 3 years ago

Are you sure that it actually really requests the OS to set the active window to Alacritty or is it just the visual perception? It might be that you think that it takes focus, but in fact it simply uses the dim colors defined by the theme, including the dimmed foreground color. As soon as the terminal window actually gets the focus again, or any process sends a signal to the terminal that implies a activation, the normal colors are rendered by Alacritty.

The dim color were introduced in #12 with a preview of the visual style added as comment.

Normal

Dimmed

Could you also please post some details about your system, like the OS, to make it easier to identify the problem.

No it does, when I run sleep 3 | tput bel, the window pops up if I click on something else.

arcticicestudio commented 3 years ago

Could you please post some details about your setup, like the OS you run, your shell and Alacritty version. Also, if possible, a screen record would be nice to get a better inside into what the problem looks like. You can simply attach the video to a comment in this issue since GitHub finally shipped video upload and inline rendering support some weeks ago.

I've tried to reproduce the behavior, using sleep 3 | tput bel as trigger command, but it works fine in multiple scenarios. I use the currently latest Alacritty version 0.7.2 and switched to multiple color schemes from Alacritty's wiki, but none of them ever hijacked the OS window focus.

To be true, I've no more idea other than referring to search again through the issues in the Alacritty repository and open a new one if it has not been reported yet and if you can reproduce the problem in a stable way.

ghost commented 3 years ago

Could you please post some details about your setup, like the OS you run, your shell and Alacritty version.

I'll add this to the first comment.

Also, if possible, a screen record would be nice to get a better inside into what the problem looks like. You can simply attach the video to a comment in this issue since GitHub finally shipped video upload and inline rendering support some weeks ago.

Ok.

I've tried to reproduce the behavior, using sleep 3 | tput bel as trigger command, but it works fine in multiple scenarios. I use the currently latest Alacritty version 0.7.2 and switched to multiple color schemes from Alacritty's wiki, but none of them ever hijacked the OS window focus.

* With _ZSH_ and _Bash_ on Arch Linux using…

  * [GNOME](https://www.gnome.org) as desktop environment with the default [Mutter](https://gitlab.gnome.org/GNOME/mutter) rendering engine.
  * [sway](https://github.com/swaywm/sway) as rendering engine and window manager.
  * [awesomeWM](https://github.com/awesomeWM/awesome) as window manager.

* With _ZSH_ and _Bash_ on macOS using…

  * the native rendering engine.
  * [Rectangle](https://github.com/rxhanson/Rectangle) as window manager.
  * [yabai](https://github.com/koekeishiya/yabai) as window manager.

To be true, I've no more idea other than referring to search again through the issues in the Alacritty repository and open a new one if it has not been reported yet and if you can reproduce the problem in a stable way.

ghost commented 3 years ago

It's not happening anymore. Looks like it was something in my config that was causing it. I will be less quick to open an issue next time.

arcticicestudio commented 3 years ago

Nice to see that it works for you now 👍🏼