e2311aaa73bcf4323e2ac24e69c1f55392258e41
This is a bit more involved than I'd like, but it seems more deterministic than using `TranslateMessage` or `ToUnicode` in all cases. This commit expands the depth of the keyboard layout probing that is performed when we detect a changed keyboard layout. We know detect starting `(Modifier, VK) -> char` for a dead key press, as well as the map of terminating `(Modifier, VK) -> char` for valid dead key presses. This information allows us to simply lookup the mapping without calling `ToUnicode`. Avoiding `ToUnicode` is desirable because it maintains a global state and it is unpredictable what else is manipulating that same state. In particular, for the ESP keyboard layout where `~` is a dead key that is reached via `AltGr 4`, there doesn't appear to be a reliable way to extract the correct mapping from it when calling `ToUnicode` in response to the various KEYUP, KEYDOWN messages. We could get it if we always called `TranslateMessage` and only looked at `WM_CHAR`, but that means that we cannot decompose `WM_CHAR` back to the raw key events when we need to. Bleh! Test Plan for this commit: * With ENG layout active, check that CTRL, ALT and so on have the intended effect in the terminal; eg: CTRL-C, CTRL-W (in vim). * Switch to pinyin layout, check that typing still invokes the IME and that it can insert text * Switch to DEU. Check that `AltGr m` produces a `mu` symbol. Check that grave (`\``) (a dead key) doesn't immediately output anything, then press `e`; that produces an `e` with a grave diacritic. Grave followed by space emits grave. Grave followed by grave emits a grave and holds the second grave; pressing `e` at this point now emits `e` with a grave diacritic. (This is a difference from the "normal" system behavior, which would just emit two graves in a row, then a regular `e`). * Switch to ESP. Check that `AltGr 4` (tilde) doesn't immediately output anything, then press `n`; that produces an `n` with the tilde diacritic. * Change `use_dead_keys = false`. Now verify in DEU that `grave` just emits grave. In ESP, verify that `AltGr 4` just emits a tilde. * Switch back to ENG. Verify that `ALT-space` pops up the system menu. refs: #275 refs: #305
Wez's Terminal
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
User facing home page at: https://wezfurlong.org/wezterm/
Screenshot of wezterm on macOS, running vim
Installation
https://wezfurlong.org/wezterm/installation.html
Getting help
This is a spare time project, so please bear with me. There are two channels for support:
- You can use the GitHub issue tracker to see if someone else has a similar issue, or to file a new one: https://github.com/wez/wezterm/issues
- There is a Matrix/Riot.im room for (potentially!) real time discussions; that is bridged from the original Gitter room.
The Matrix/Gitter room is probably better suited to questions than it is to bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.
Description
The agentic terminal: a WezTerm fork with LLeMbas built in
316 MiB
0 Stars
2 Watchers
0 Forks
Languages
Rust
97.7%
Python
1%
Shell
0.9%
Nix
0.2%
