the toggle button for the backlight is the Scroll Lock button
when I alt-tab out of git bash, backlight stays off until I manually turn it back on
OS is Windows 10
doesn't happen in Windows Terminal
From the mintty help (on which git bash term is built):
Scroll Lock handling
The ScrollLock key is one of the most useless keys on typical PC keyboards as it is mostly ignored by software nowadays, and yet has its own LED. However, there are two historic features that could be associated with "ScrollLock". One is the VT100 NoScroll key which would hold output via the terminal, the other is a Windows function to switch cursor keys to screen scrolling as still used by the Excel program. Mintty provides both features as user-definable functions, in two variants each. Functions are no-scroll and scroll-mode (referring to those two features) which would be reset by any key input, and toggle-no-scroll and toggle-scroll-mode which would switch the respective feature on or off. These functions can be attached to any user-assignable function key or special key, including the ScrollLock key, with setting KeyFunctions. Mintty manages the ScrollLock keyboard light to reflect either of these functions activated, trying to decouple the light indication from the ScrollLock key while in a mintty window.
Each time the mintty window receives focus, this fake keypress is triggered it seems.
Further reading:
Manage keyboard LEDs (ManageLEDs=7)
Mintty manages the keyboard indicator lights (LEDs) for the CapsLock, Numlock, and ScrollLock state in order to achieve consistent indication. If any of these keys have a user-defined function attached, their usage shall not affect the visual keyboard modifier indication. Also, if a scroll feature is activated (no-scroll or scroll-mode), the ScrollLock indication shall indicate the current state of the terminal window. The ScrollLock light is restored to its previous state if the terminal window gets out of focus or terminates. This setting can disable LED management for ScrollLock (ManageLEDs=3) or for all modifiers (ManageLEDs=0).
Which means you should add the line
ManageLEDs=3 To your
~/.minttyrcfile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With