Files
LLeMbas-TTY/docs/config/lua/window/leader_is_active.md
T
Wez Furlong 627001762e rename dead_key_is_active -> composition_status, dead_key_cursor -> compose_cursor
Since the composition state isn't strictly tied to dead keys, use
a name that better reflects that.
2022-01-09 08:39:21 -07:00

30 lines
658 B
Markdown

# wezterm:leader_is_active()
*Since: nightly builds only*
Returns `true` if the [Leader Key](../../keys.md) is active in the window, or false otherwise.
This example shows `LEADER` in the right status area, and turns the cursor orange,
when the leader is active:
```lua
local wezterm = require 'wezterm';
wezterm.on("update-right-status", function(window, pane)
local leader = ""
if window:leader_is_active() then
leader = "LEADER"
end
window:set_right_status(leader)
end);
return {
leader = { key="a", mods="CTRL" },
colors = {
compose_cursor = "orange",
},
}
```
See also: [window:composition_status()](composition_status.md).