1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-18 10:52:16 +03:00
Commit Graph

7344 Commits

Author SHA1 Message Date
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
54a65a5401
kitty keeb: adjust legacy encoding logic
Just consider all ascii alphanumeric and punctuation as legacy
so that we don't decide to encode those as escapes when not required.

refs: #3315
2023-04-09 21:53:46 -07:00
Wez Furlong
70a8af479d
cargo update 2023-04-09 21:46:12 -07:00
Wez Furlong
a9165ae4c4
kitty keeb: fixup tests
refs: #3315
2023-04-09 13:22:25 -07:00
Wez Furlong
b704ec6d70
kitty keyboard: improve mode 1 support
We don't need to encode as many keys in mode 1.

refs: #3315
2023-04-09 13:05:23 -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
b646c36e34
refactor: tidy up some logging 2023-04-09 12:26:32 -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
Wez Furlong
397593be5c
kitty keeb: fixup shifted character encoding
refs: https://github.com/wez/wezterm/issues/3474
2023-04-08 20:01:10 -07:00
Wez Furlong
0540301121
kitty keeb: add test case for #2546
This passes, so I'm assuming that one of the other kitty
commits from today has resolved this.

refs: https://github.com/wez/wezterm/issues/2546
2023-04-08 19:28:22 -07:00
Wez Furlong
8bb39bd6f3
fixup kitty keyup events for alphabetical keys
refs: https://github.com/wez/wezterm/issues/3220
2023-04-08 19:19:27 -07:00
Wez Furlong
d239e65e64
fixup kitty keyboard encoding for F1-F4
refs: https://github.com/wez/wezterm/issues/3473
2023-04-08 18:19:07 -07:00
Wez Furlong
94359d2972
build: fix some log spew on macos
```
warning: voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
warning:                      ^
warning: zlib/zutil.c:315:20: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
```
2023-04-08 17:03:03 -07:00
Wez Furlong
5e5989f3e2
build: revise dep graph for version changes
Previously, the config crate would get rebuilt each time the
git state changed, which has a lot of fan out and makes the build
take longer than it really needs to.

This commit breaks out the version changing stuff to its own crate
and then provides a runtime mechanism for assigning the version
information back into the config crate.

The env-bootstrap crate is responsible for setting that up.
2023-04-08 17:03:03 -07:00
Wez Furlong
4667a4b4be
ratelimit: remove indirect dep on quanta
refs: https://github.com/wez/wezterm/issues/3472
2023-04-08 15:47:34 -07:00
Wez Furlong
b9b0f36692
fix OS keymapping issue with modals
Need to defer to the second pass (when we have mapped from physical
keys) before we route the key event to the modal.

refs: https://github.com/wez/wezterm/issues/3470
2023-04-08 15:31:48 -07:00
Wez Furlong
f535c5bdc0
docs: update for 20230408-112425-69ae8472 release 2023-04-08 15:01:26 -07:00
Wez Furlong
69ae847273
windows: fix: mess up full screen mode on config reload
refs: https://github.com/wez/wezterm/issues/3439
2023-04-08 11:24:25 -07:00
Wez Furlong
5fb6db8774
pty: fix unused import warning on windows 2023-04-08 11:13:12 -07:00
Wez Furlong
9e03d24402
windows: fix warning; mut not required here 2023-04-08 11:12:38 -07:00
Wez Furlong
62256c80b4
config: defer evaluating default wsl domains
The stack trace in https://github.com/wez/wezterm/issues/3425
shows a recursive borrow triggered indirectly by spawning
a subprocess and having that trigger the wndproc.

This commit doesn't really fix the recursive problem, but may
sidestep it, and it's probably best to avoid always running
the `wsl` command to get this list anyway, similar to the
change in 25255d90d6

refs: https://github.com/wez/wezterm/issues/3425
2023-04-08 08:51:47 -07:00
Wez Furlong
436847665d
docs: update for wezterm replay changes
refs: #3446
2023-04-08 08:35:14 -07:00
Wez Furlong
b4c8f7c01f
docs: explain what font shaping actually is 2023-04-08 07:52:55 -07:00
Wez Furlong
84f7fb9f3b
docs: add tags to a number of pages 2023-04-08 07:48:40 -07:00
Wez Furlong
36d5307b80
wayland: fix webgpu invalidation issue
For whatever reason, it appears as though the wayland
frame event stuff is unreliable when used with webgpu,
so we simply avoid using it.

refs: https://github.com/wez/wezterm/issues/3126
2023-04-07 22:15:07 -07:00
Wez Furlong
6bd3664d3d
wezterm replay: add --explain-only and --cat options
refs: https://github.com/wez/wezterm/issues/3446
2023-04-07 18:19:47 -07:00
Wez Furlong
7b40f01054
switch to fancy-regex crate
Enables back references and look around assertions for quick select
and hyper link rules

refs: https://github.com/wez/wezterm/issues/3247
2023-04-07 17:39:00 -07:00
Wez Furlong
b0d0e4c1be
docs: for integrated title buttons
refs: https://github.com/wez/wezterm/pull/2722
refs: https://github.com/wez/wezterm/issues/1180
2023-04-07 13:10:45 -07:00
Wez Furlong
56ae2fe276
Push folks towards the bug report template
by disabling the blank issue template
2023-04-07 11:50:58 -07:00
Wez Furlong
cbbe0da9d7
schemes: fix origin url when importing toml files 2023-04-07 10:48:19 -07:00
Wez Furlong
0a0c939c6f
add more color schemes
Primarily those from https://codeberg.org/anhsirk0/wezterm-themes
but also updated the others
2023-04-07 10:43:32 -07:00
Wez Furlong
da5ec63b26
docs: update color scheme versions
forgot to do this as part of a prior release
2023-04-07 10:41:53 -07:00
Wez Furlong
a5e89cda3d
windows: speculative fix for recursive borrow
refs: https://github.com/wez/wezterm/issues/3425
2023-04-07 09:29:20 -07:00
Wez Furlong
b45a4d7215
add wezterm.has_action
refs: https://github.com/wez/wezterm/issues/3454
2023-04-06 20:46:32 -07:00
Wez Furlong
b1c58bad39
Make background painting more consistent when window is transparent
These conditions were from the earliest days of panes and aren't
needed any more, especially because they make it hard to have
consistent behavior!

refs: https://github.com/wez/wezterm/issues/3450
2023-04-06 19:55:55 -07:00
Wez Furlong
2843adb680
fix build on windows 2023-04-06 17:26:35 -07:00
Wez Furlong
60566c7119
docs: fix link 2023-04-06 17:17:06 -07:00
Wez Furlong
0ca050e09d
expose the tty name associated with a pane 2023-04-06 17:13:07 -07:00
Wez Furlong
889390a448
docs: update gui.get_appearance example for mux
refs: https://github.com/wez/wezterm/issues/3453
2023-04-06 15:55:20 -07:00
Wez Furlong
760864b6b2
quick select: make user patterns take precedence
I think the future for this is to extend the Pattern type to accept
a list of regexes and use a RegexSet to unambiguously handle multiple
patterns with captures.

That might help a little with https://github.com/wez/wezterm/issues/3247
but the stated use in that issue may not even work with the rust
regex crate.

For now we do the simple thing and match the user's patterns
first.

refs: https://github.com/wez/wezterm/issues/3456
2023-04-06 15:52:52 -07:00
Wez Furlong
6ab01ce619
docs: show schemes in the per-page toc 2023-04-06 12:59:56 -07:00
Wez Furlong
e3e9821c4d
Add InputSelector action
Allows prompting the user to select from a list and then
triggering some action on the selected item.

This is the guts of the launcher menu hooked up to user-supplied
arbitrary entries.
2023-04-05 17:22:09 -07:00
Wez Furlong
153497d01d
admit defeat to intel shader weirdness
I dug out my pixelbook which has intel graphics and runs linux
to try to make sense of this issue, but I'm baffled.
It doesn't appear to NaN going in, but we end up with something
weird happening if we don't fixup the alpha.

Relevant entry to the discussion/background on this is:
https://github.com/wez/wezterm/issues/1180#issuecomment-1496102764

I don't think it's worth sweating over this, so let's just suck it
up.

refs: https://github.com/wez/wezterm/issues/1180
2023-04-05 15:07:22 -07:00
Wez Furlong
37e8a5041f
refine charselect move logic per comments on #3449 2023-04-05 08:45:02 -07:00
Chris
6354f01327
character select pgup/down, less jerky navigation, selected centered in list (#3449)
* character select pgup/down support for bigger jumps

* fix jerky selected_row clamping, keeps selected center offset

* die dead code

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* thx silly rustisms

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* charselect movements now spcified by amount, or 0 which does full pgsz

* rustfmt

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-04-05 08:41:30 -07:00
Wez Furlong
dacd19c9f7
docs: ... and format the examples 2023-04-05 08:19:54 -07:00
Wez Furlong
3910291d4d
docs: update format-tab-title examples
nudge folks towards making their custom formatting aware of the
new tab title stuff
2023-04-05 08:18:50 -07:00
Wez Furlong
96f1585b10
wezterm cli list: add is_active and is_zoomed fields to json output
is_active is true if the pane is considered to be the active pane
within its containing tab.

If you want to reason about the focused pane regardless of tab,
`wezterm cli list-clients` has that pane_id.

refs: https://github.com/wez/wezterm/issues/3413
2023-04-05 07:30:38 -07:00
Wez Furlong
9b67a71485
add wezterm cli get-pane-direction
refs: https://github.com/mrjones2014/smart-splits.nvim/issues/53
2023-04-05 07:00:49 -07:00
Wez Furlong
336fefb52f
Add PromptInputLine and examples of (re)naming tabs/workspaces
refs: https://github.com/wez/wezterm/issues/522
refs: https://github.com/wez/wezterm/issues/1598
2023-04-04 21:11:08 -07:00