89 Commits
Author SHA1 Message Date
Mikhail f. Shiryaev aea9b9f2e2 Fix ESC key encoding in kitty mode with disambiguate flag (#7787) 2026-06-20 00:38:14 +02:00
Wez Furlong 0cd3fe8f97 wezterm-escape-parser: allow building no_std (but with alloc)
This commit makes a number of parts of wezterm's core
parsing functionality no_std compatible, but requiring alloc.

In the no_std environment, several lookup tables that would
normally have been used to accelerate some operations are
not available and we instead fall back to an O(n) operation.
2025-05-10 15:07:20 -07:00
Jun Wu 50ea8c3811 termwiz: lazy_static => std::sync::LazyLock
`LazyLock` is a stdlib drop-in replacement to drop the lazy_static
dependency.
2025-04-12 22:05:40 -07:00
Jay Madden c0b29fef24 feat(macos): add support for titlebar background matching theme background on macos
closes: #6558
2025-03-08 17:13:37 -07:00
Wez Furlong edcdefda3b workspace-ify the deps
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.

Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.

This will help to manage the versions of deps in wezterm centrally.

Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.

closes: https://github.com/wezterm/wezterm/pull/6668
2025-02-12 09:43:36 -07:00
amadeusandWez Furlong fcae187b29 feat(macOS): add support to disable rounded corners on macOS (#6587)
* feat(macOS): add support to disable rounded corners on macOS

* Update wezterm-input-types/src/lib.rs

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2025-02-08 19:21:44 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
Martin von Zweigbergk 4bf0007cef add a few missing license files
I didn't symlink to the license file in the root because it mentions
license that don't seem to apply to the crates I added license files
to here.

I used the year each directory was created as the first copyright
year.

I didn't add license files to all crates because I don't need them for
what I'm working on right now, and I want to avoid having to figure
out which licenses apply to which crates.

#2347
2025-01-24 15:40:57 -07:00
Wez Furlong d5ca5509b9 wezterm-input-types: prep for crates.io publish 2024-01-27 12:13:39 -07:00
Gabriel Nützi 089e07152a fix: Correct SUPER modifier key handling in kitty protocol (#4605) 2023-12-01 07:51:06 -07:00
Wez Furlong 59b8664eb3 fixup F21+ handling
The warnings were not noticed in the original PR.
Those warnings were actually errors.
Promote warnings to error in the mapping logic to prevent
this sort of thing from slipping through in the future,
and fixup the errors.

refs: #3935
refs: #3937
2023-08-06 16:15:35 -07:00
Ovidiu IonescuandOvidiu Ionescu 9c215e15fd fix: issue 3935 handle F13-F24 (#3937)
* fix: issue 3935 handle F13-F24

* Added F13-F24 in kitty mode

* fix: replace trailing ~ with u in escape sequence

* fix: patch ending char for function keys

---------

Co-authored-by: Ovidiu Ionescu <ovidiu@ionescu.net>
2023-08-06 10:22:14 -07:00
Wez Furlong b54b0ce404 fix old NF 2.0 symbols for shortcuts in command palette
These got overlooked because they weren't using symbolic names.
Fix that while we're in here.

refs: #3988
2023-07-14 11:08:39 -07:00
Wez Furlong 8c975a7681 keys: don't hide mouse cursor when pressing only modifier keys
Further constrain the hiding logic for key-down events, so that
we are less likely to hide for things ctrl-shift-c when the user
is mousing around and copy/pasting.

Also, consider CapsLock to be a modifier for this and other
similar purposes.

refs: #3570
refs: #3306
2023-04-20 07:53:20 -07:00
Wez Furlong 075388fbe5 add window:keyboard_modifiers() method 2023-04-16 19:53:32 -07:00
Wez Furlong 572c31fb30 kitty keeb: fixup backspace
refs: #2546
2023-04-16 14:37:24 -07:00
Wez FurlongandDominik Kreutzer 3f820b93d9 Fix win32 input mode encoding inconsistencies
This pulls in almost all of the original PR in #2235.
I skipped a dead key case that I recall being tricky:
I didn't want to break the non win32-input mode version
of that.

I'd be happy to have that case re-evaluated in a smaller
PR where we can focus on its details.

Co-authored-by: Dominik Kreutzer <kreudom@gmail.com>
2023-04-16 13:07:18 -07:00
Wez Furlong 5fc9349c92 kitty keeb: use raw modifiers rather than normalized modifiers
refs: https://github.com/wez/wezterm/issues/2546
2023-04-15 22:57:53 -07:00
Wez Furlong bdbedad38a kitty keyboard: more test cases for #2546 2023-04-15 19:45:12 -07:00
Wez Furlong d0f972ab37 kitty keyboard: refine numpad reporting some more
refs: https://github.com/wez/wezterm/issues/3478
2023-04-15 19:40:38 -07:00
Wez Furlong 2b9ee388e3 refactor: move encode_modifiers to Modifiers::encode_xterm 2023-04-15 19:27:57 -07:00
Wez Furlong a562cb5a92 kitty keeb: avoid sending function codes in mode 1
refs: #3626
2023-04-15 19:15:26 -07:00
Wez Furlong c544b0edce fix termwiz non-serde enabled build 2023-04-15 16:15:06 -07:00
Wez Furlong addeb9e248 add test case for #3526 2023-04-15 15:50:50 -07:00
Wez Furlong 46bc9f57c5 fix test build 2023-04-15 15:42:05 -07:00
Wez Furlong 3c40846d95 keyboard: move led status to separate enum 2023-04-15 14:52:54 -07:00
Wez Furlong 36d9e13c81 refactor: dedup ctrl_mapping function 2023-04-13 14:25:47 -07:00
Wez Furlong 7d66bc761d termwiz::Modifiers is now wezterm_input_types::Modifiers 2023-04-13 14:18:13 -07:00
Wez Furlong 0abc28dae0 fix numlock and capslock interfering with mouse assignments
refs: https://github.com/wez/wezterm/issues/3514

follow up from eaab3d08ae
2023-04-13 07:41:27 -07:00
Wez Furlong 03d2df04ce kitty keeb: support report associated text
refs: #3484
2023-04-10 16:52:54 -07:00
Wez Furlong aa3f486a91 kitty keeb: see through num pad mappings
Always look through to the physical keys when processing the numpad.

refs: #3478
2023-04-10 10:45:17 -07:00
Wez Furlong e241ea58be kitty keeb: move encoding logic to wezterm-input-types
We need access to the underlying raw/physical key in order
to correctly encode in some modes, so we need the full KeyEvent
struct for that.

Move the encoder up so it sits alongside the win32 input mode
encoder.

This should give us better results for both shifted/unshifted
and the "base layout" (US english) representations of a number
of keys.

Note that this is still not 100% technically correct: the unshifted
keys require knowledge of the keyboard layout that we don't have
at this OS-independent layer.

Right now we're assuming a US layout to unshift punctuation, which
is not right if you're not using that layout.  To resolve that,
more work is needed on each OS to be able to extract that information
and then to store it in the KeyEvent.

refs: https://github.com/wez/wezterm/issues/3479
refs: https://github.com/wez/wezterm/issues/2546
2023-04-10 08:54:03 -07:00
Wez Furlong f4995511e2 keyboard: improve support for numpad buttons
We were missing encoding of these for the base xterm encoding
(I haven't daily driven a keyboard with a numpad in over 10 years!).

Improve mapping for the kitty protocol.

refs: https://github.com/wez/wezterm/issues/3478
2023-04-09 12:28:30 -07:00
Wez Furlong 2dcf7ad98d keyboard: plumb more modifier+state information through
This commit teaches the termwiz layer about positional modifiers,
and expands our modifier concept to also pass through led states
such as caps lock and num lock.

Those aren't actually keyboard modifiers, but the state is useful
to recognize.

Adjust the shift key normalization so that we don't uppercase
alpha characters when both SHIFT and CAPS_LOCK are held.
This processing will remove both SHIFT and CAPS_LOCK in that
situation.

Add a method to KeyEvent that will undo the OS keyboard layer
normalization of positional to generic modifier key presses.
eg: the OS may map LeftControl -> Control, but we actually
prefer to have LeftControl so if we can unambiguously reverse
that mapping, we do so.

refs: #3476
refs: #3475
2023-04-09 10:34:53 -07:00
Jalil David Salamé Messina b32863cc2f fix(clippy): Implement From instead of Into
Implementing `From` is prefered as this also implements the `Into` trait, may
not be desireable for code size/compilation time reasons.
2023-04-03 08:31:12 -07:00
Wez Furlong 42c3f27f3c integrated title bar: default to mac style on mac 2023-03-31 23:23:10 -07:00
Wez Furlong 422ae51577 allow using Gnome and Windows styles on macos.
Rename macos to MacOsNative to make its intended purpose clearer
2023-03-31 20:35:26 -07:00
YuraIz 6b2137de0b integrated-title-bar: Add Native button style parameter 2023-03-31 19:59:03 -07:00
YuraIz eab21a669d integrated-title-bar: Improve windows support 2023-03-31 19:53:45 -07:00
YuraIz 01aeb506c0 integrated-title-bar: Update config options
and rename the "FANCY" option to "INTEGRATED_BUTTONS"
2023-03-31 19:51:46 -07:00
YuraIz baebf907f6 integrated-title-bar: Remove macos button style
macos uses native buttons
2023-03-31 19:45:28 -07:00
YuraIz 6c40c2397e integrated-title-bar: Add button style option 2023-03-31 19:45:28 -07:00
YuraIz d39bccca10 integrated-title-bar: Add option to remove useless buttons 2023-03-31 19:45:28 -07:00
YuraIz 2333046e1b integrated-title-bar: Add button placement option 2023-03-31 19:45:26 -07:00
YuraIz 36f41af81e integrated-title-bar: Add window buttons to the tabbar 2023-03-31 19:44:13 -07:00
Wez Furlong c5213b4f85 palette: add config for how ui key caps render
added a new `ui_key_cap_rendering` option that accepts the following
values:

```lua
-- Super, Meta, Ctrl, Shift
config.ui_key_cap_rendering = 'UnixLong'

-- Super, M, C, S
config.ui_key_cap_rendering = 'Emacs'

-- Apple macOS style symbols
config.ui_key_cap_rendering = 'AppleSymbols'

-- Win, Alt, Ctrl, Shift
config.ui_key_cap_rendering = 'WindowsLong'

-- Like WindowsLong, but using a logo for the Win key
config.ui_key_cap_rendering = 'WindowsSymbols'
```

refs: https://github.com/wez/wezterm/issues/3335
2023-03-25 09:18:52 -07:00
Wez Furlong d60cdbf74e palette: show key assignment alongside entries
For items in the main set of key assignments, show the keyboard
shortcut to the right.

Some items have multiple key assignments; we show only the first
one. We'll probably want to be a bit smarter. For instance,
both linux and windows tend to occupy the Windows/Super key
assignments, so we should probably prioritize showing the Ctrl+Shift
variants on those platforms.

refs: https://github.com/wez/wezterm/issues/3335
2023-03-24 23:34:49 -07:00
Jalil David Salamé Messina cb9dc3a800 fix(clippy): Remove unnecessary clone/to_string calls 2023-03-16 07:40:12 -07:00
Wez Furlong b4dae6c2a3 allow window_decorations to work with config_builder
We need to manually convert to string, as the default ToDynamic
impl encodes the underlying bits value from the bitfield and
that doesn't round trip with the try_from String impl
2023-02-01 15:01:28 -07:00
Wez Furlong f4096803e3 window_decorations: add MACOS_FORCE_(EN|DIS)ABLE_SHADOW
Evidence:
* https://github.com/wez/wezterm/issues/310#issuecomment-718288028
* https://github.com/wez/wezterm/issues/2669#issuecomment-1379829866
* https://github.com/wez/wezterm/issues/2669#issuecomment-1408144931

seems to suggest that window shadows hurt performance,
so add a way to disable them independently from window opacity.

You may use:

```
config.window_decorations = "TITLE|RESIZE|MACOS_FORCE_DISABLE_SHADOW"
```

for this.

refs: https://github.com/wez/wezterm/issues/2669
2023-01-31 22:47:59 -07:00