Files
LLeMbas-TTY/docs/config/lua/keyassignment/CharSelect.md
T
mgpinf 9606fa2569 Add font configuration option for ActivateCommandPalette, CharSelect, PaneSelect (#6696)
* feat: option to configure font for ActivateCommandPalette, CharSelect, PaneSelect

Add configuration option for font for the below entities:
- ActivateCommandPalette
- CharSelect
- PaneSelect

For the above entities, if the font is not set in configuration, it
defaults to the font resolved in config.window_frame.font. This is in
order to maintain existing behavior of using the font resolved in
config.window_frame.font

* docs: documentation for added configuration options

Add documentation for below configuration options:
- command_palette_font
- char_select_font
- pane_select_font

* refactor: rename EntityFont to Entity

* docs: add example configuration in char_select_font

Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165

* docs: add example configuration in pane_select_font

Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165

* docs: add example configuration in command_palette_font

Apply changes mentioned in suggestion:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085165

* refactor: calculate make_bold in make_entity_font_impl method

* refactor: resolve font_size based on Entity

Since we can fetch font_size based on entity, we resolve it in
'make_entity_font_impl'. This removes the need to pass the pref_size
parameter

Apply changes mentioned in suggestions:
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085350
https://github.com/wezterm/wezterm/pull/6696#discussion_r1986085949
2025-03-09 15:34:32 -07:00

2.8 KiB

CharSelect

{{since('20220903-194523-3bb1ed61')}}

Activates Character Selection Mode, which is a pop-over modal that allows you to browse characters by category as well as fuzzy search by name or hex unicode codepoint value.

Characters are categorized into the following groups:

  • "RecentlyUsed" - recently selected characters, ordered by frecency
  • "SmileysAndEmotion"
  • "PeopleAndBody"
  • "AnimalsAndNature"
  • "FoodAndDrink"
  • "TravelAndPlaces"
  • "Activities"
  • "Objects"
  • "Symbols"
  • "Flags"
  • "NerdFonts" - glyphs that are present in Nerd Fonts
  • "UnicodeNames" - all codepoints defined in unicode

The following key assignments are available (they are not currently configurable):

Key Action
UpArrow Move Up
DownArrow Move Down
Enter Accept the current item, copy it to the clipboard, insert it into the active pane, and cancel the modal
Esc Cancel the modal
CTRL-g Cancel the modal
CTRL-r Cycle to the next group of characters
CTRL-SHIFT-r Cycle to the previous group of characters
CTRL-u Clear text input

Typing a name or a hex unicode codepoint value will fuzzy search across all possible groups (not just the current group) and filter the results.

This action is by default assigned to CTRL-SHIFT-U (U for Unicode).

The default assignment is equivalent to this config:

-- Control the size of the font.
-- Uses the same font as window_frame.font if char_select_font option is not set
-- char_select_font_size = 18.0,

config.keys = {
  {
    key = 'u',
    mods = 'SHIFT|CTRL',
    action = wezterm.action.CharSelect {
      copy_on_select = true,
      copy_to = 'ClipboardAndPrimarySelection',
    },
  },
}

The CharSelect action accepts a lua table with the following fields:

  • copy_on_select - a boolean that controls whether hitting Enter to select an item will copy to the clipboard, in addition to sending the item to the active pane. The default is true, but you can set it to false if you prefer.
  • copy_to - allows you to control where the item will be copied to. Accepts the same values as CopyTo. The default is 'ClipboardAndPrimarySelection'.
  • group - an optional group to pre-select. You may use any of the groups listed above (eg: "SmileysAndEmotion"). If omitted, wezterm will default to "RecentlyUsed" if you have previously selected an item, or "SmileysAndEmotion" otherwise.

See also: