1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00
Commit Graph

4903 Commits

Author SHA1 Message Date
Wez Furlong
5f26746286 window/gui: remove raw/phys fallback fields from KeyEvent
Since we now have RawKeyEvent and a sane way to indicate handling,
we don't need these any more, and it simplifies key dispatch to
remove them.

refs: #1483
2022-01-03 09:13:55 -07:00
Wez Furlong
2616efa72e window: fix test build 2022-01-03 09:13:38 -07:00
Wez Furlong
83052530d9 window: populate live_resizing for Windows
refs: https://github.com/wez/wezterm/issues/1491
2022-01-03 08:41:55 -07:00
Wez Furlong
49904eac9c window: populate live_resizing for x11/wayland
We don't really know for sure, but we can make a reasonable deduction on
X11.

refs: https://github.com/wez/wezterm/issues/1491
2022-01-03 08:38:03 -07:00
Wez Furlong
0224f65fed gui: avoid glitchy live resize
Pass down whether we are in a live resize to the gui layer, so that
we don't incorrectly assume that the scale has changed, and fight
with the window manager.

Built this on my mac: will need to fixup for windows and linux.

refs: https://github.com/wez/wezterm/issues/1491
2022-01-03 08:29:05 -07:00
Benoit de Chezelles
462a256e83 Add missing New in latest release's changelog 2022-01-03 07:04:01 -08:00
Wez Furlong
c0502012d5 redefine key assignments in terms of physical key location
and then remove horrible mac hacks.

This resolves the root cause for some horrible mac key mapping stuff
that is responsible for at least 3 different user issues by making the
default key assignments work from the physical key location.  That makes
them unambiguous.

refs: https://github.com/wez/wezterm/issues/601
refs: https://github.com/wez/wezterm/issues/760
refs: https://github.com/wez/wezterm/issues/1080
refs: https://github.com/wez/wezterm/issues/1483
2022-01-03 00:22:51 -07:00
Wez Furlong
369f388f90 window: macOS: workaround key repeat issue when use_ime=true
The logic is explained in comments in this commit.

While we're at it, tweak the IME window position so that it
sits below the text.

refs: #1131
2022-01-02 23:36:57 -07:00
Wez Furlong
05073fbaf9 window: macos: fix double pressing of dead key
We want it to emit the original key; it wasn't changing
any state.
2022-01-02 21:27:17 -07:00
Wez Furlong
8a476b70ab window: macos: generate dead key events
refs: #688
2022-01-02 21:14:59 -07:00
Wez Furlong
7988e65526 cargo update 2022-01-02 19:48:38 -07:00
Wez Furlong
028026049d add window:dead_key_is_active window:leader_is_active
This commit adds a couple of helper methods that provide insight into
the state of the keyboard layer.

The intent is for users to add status information about the keyboard
state.

This commit also ensures that we schedule an update when the leader
key duration expires, and ensures that we close out the leader state
for an invalid key press.

refs: #686
closes: #688

```lua
local wezterm = require 'wezterm';

wezterm.on("update-right-status", function(window, pane)
  local leader = ""
  if window:leader_is_active() then
    leader = "LEADER"
  end
  local dead = ""
  if window:dead_key_active() then
    dead = "DEAD"
  end
  window:set_right_status(leader .. " " .. dead)
end);

return {
  leader = { key="a", mods="CTRL" },
  colors = {
    dead_key_cursor = "orange",
  },
}
```
2022-01-02 19:41:21 -07:00
Wez Furlong
c29212be49 add colors.dead_key_cursor to signal dead and leader key processing
When set, the cursor will change to this color during dead key
or leader key processing.

```lua
return {
  colors = {
    dead_key_cursor = "orange",
  },
}
```

refs: #686
refs: #688
2022-01-02 17:49:32 -07:00
Wez Furlong
306133af7a window: implement dead key status events for x11/wayland
refs: #688
2022-01-02 17:20:29 -07:00
Wez Furlong
8d9ae31ff0 window: fix example build 2022-01-02 17:17:47 -07:00
Wez Furlong
79ab6e8103 window: add deadkeystatus event
Plumbs it for Windows.
Doesn't do anything useful with it yet.

refs: #688
2022-01-02 17:00:18 -07:00
Wez Furlong
2d62bffe41 window: fix CTRL+C with Russian keyboard on windows
Turns out that we had the same issue on Windows

refs: #678
2022-01-02 16:50:26 -07:00
Wez Furlong
ea964e74e3 window: generate RawKeyEvent on Windows
refs: refs: https://github.com/wez/wezterm/issues/877
2022-01-02 16:35:50 -07:00
Wez Furlong
d9851e5c2a window: generate RawKeyEvents on X11/Wayland
Similar to d5726ba91a but for X11/Wayland.

Handling a RawKey event cancels any composition or further processing
on the same key.

refs: https://github.com/wez/wezterm/issues/877
2022-01-02 16:14:40 -07:00
Wez Furlong
1a342adfc1 window: fix test build. remove dead code 2022-01-02 15:37:34 -07:00
Wez Furlong
6feabb8178 window: adjust xkb handling for future RawKeyEvent support
This moves the event dispatching into the keyboard processor,
which will allow for the processor to skip feeding an event
into the dead key/composition stuff if a key assignment is
handled.

It doesn't actually do that bit yet though, as the wayland
key repeat processing was a bit more involved and I wanted
to constrain the scope of this commit.

refs: #877
2022-01-02 15:33:42 -07:00
Wez Furlong
d5726ba91a window: add RawKeyEvent concept
on macos only (for now), we generate a RawKeyEvent prior to
dead key or IME composition and route it to the window to give it
a chance to handle the event.

RawKeyEvent handling is scoped only to key assignments, not generating
input for the terminal.

A raw key event can be marked as handled to prevent moving on to
performing composition and generating cooked key input.

refs: https://github.com/wez/wezterm/issues/877
2022-01-02 15:04:27 -07:00
Wez Furlong
43d9392c52 window: x11/wayland: extract utf8 version of key from key state
Previously, we'd take a couple of guesses at how to map the key
to a utf8 value, but! the keyboard state has a method that can tell
us what to use.

This is important in non-latin keymaps where, for example, the `c`
key generates cyrillic small letter es and we'd end up sending
CTRL + that through to the terminal when CTRL is held down.

If we get the utf8 string from the keyboard layer then we get
CTRL+c instead, and that is what we want.

refs: https://github.com/wez/wezterm/issues/678
2022-01-02 11:16:52 -07:00
Wez Furlong
c05491f831 fonts: fix fontconfig monospace alias resolution
This got broken by 58ece29f00
This commit structures things so that we're less likely to overlook
this in the future!

cc: @unrelentingtech

refs: #1250
2022-01-02 08:26:19 -07:00
Wez Furlong
69e8d9144c gui: allow matching keys with a physical position
```lua
local wezterm = require 'wezterm'

return {
  debug_key_events = true,
  keys = {
    {key="phys:Q", action=wezterm.action{SendString="woot"}},
  },
}
```

The above will send "woot" to the pane whenever the key in same
physical position as Q on an ANSI standard US keyboard is pressed.

refs: https://github.com/wez/wezterm/issues/1483
2022-01-02 01:20:21 -07:00
Wez Furlong
822202b7be window: add some comments about xkd lookups 2022-01-02 00:52:46 -07:00
Wez Furlong
e8967d9c17 window: remove stray debug logging 2022-01-02 00:50:19 -07:00
Wez Furlong
30a390053a window: track phys_code on X11/Wayland
We don't do anything useful with it yet

refs: https://github.com/wez/wezterm/issues/1483
2022-01-02 00:47:04 -07:00
Wez Furlong
45631389c3 window: track phys_code on Windows
We don't do anything useful with it yet

refs: https://github.com/wez/wezterm/issues/1483
2022-01-01 22:43:12 -07:00
Wez Furlong
d714c5d5b6 window: track phys_code on macos
We don't do anything useful with it yet

refs: https://github.com/wez/wezterm/issues/1483
2022-01-01 22:04:59 -07:00
Wez Furlong
b15907f61f input-types: introduce PhysKeyCode type
Based on the mac constants of the equivalent functionality;
may need some tweaking for other OS's.

refs: https://github.com/wez/wezterm/issues/1483
2022-01-01 21:35:37 -07:00
Wez Furlong
cd8754ae6e docs: link to get_builtin_color_schemes from color scheme section 2022-01-01 18:11:59 -07:00
Wez Furlong
487ee976de docs: note about kitty image protocol on features page 2022-01-01 17:58:58 -07:00
Wez Furlong
fb8de1b5f3 Revert "ci: add centos 9"
This reverts commit fc069f9298.
Turns out centos 9 isn't a thing in docker (yet?)
2022-01-01 17:45:24 -07:00
Wez Furlong
fc069f9298 ci: add centos 9 2022-01-01 17:43:44 -07:00
Wez Furlong
4238488a9b docs: suggest that people use default_gui_startup_args
instead of connect_automatically
2022-01-01 17:41:52 -07:00
Wez Furlong
6502aa54d6 docs: more adjustments for fancy tabs 2022-01-01 17:35:27 -07:00
Wez Furlong
24840f7e13 docs: add some info about fancy tab bars 2022-01-01 17:14:33 -07:00
Wez Furlong
2d303ec54c docs: update for 20220101-133340-7edc5b5a release 2022-01-01 13:36:37 -07:00
Wez Furlong
7edc5b5ab0 ci: urgh, try another way 2022-01-01 13:33:40 -07:00
Wez Furlong
e11b9460ef ci: try alternative way of passing tag name 2022-01-01 13:10:08 -07:00
Wez Furlong
f2c0407775 docs: fix typo in changelog 2022-01-01 12:49:05 -07:00
Wez Furlong
ea7030ae11 clarify the purpose of wezterm start in the --help output
This makes it a bit more understandable/discoverable.

refs: #1478
2022-01-01 12:44:38 -07:00
Wez Furlong
8251e04c63 gui: invalidate windows resources when icon changes
I noticed that by myself and another user who built from source
still had the old icon show up.
2022-01-01 12:15:03 -07:00
Wez Furlong
09a705b78f mux: fix unix build 2022-01-01 11:38:42 -07:00
Wez Furlong
58ece29f00 fonts: defer best match until we have font_dirs + locator + builtin
A user reported an issue where having just Roboto Thin installed
caused the title font to use that one, rather than the desired
Roboto Bold.

This commit adjusts the font matching code to accumulate candidates
from each of the font_dirs, locator and built-in font locations,
and then find the best match.
2022-01-01 11:34:39 -07:00
Wez Furlong
e148cfe8e3 procinfo: tidy up windows impl a bit 2022-01-01 10:01:19 -07:00
Wez Furlong
6a7fd37d34 procinfo: add some comments 2022-01-01 09:53:56 -07:00
Wez Furlong
5660942055 procinfo: add windows console field. mux: ignore non-console procs
When considering the fg process, we don't want a newly spawned
notepad.exe to show as the fg process in a cmd/pwsh pane, as it
runs async from the console and isn't attached to it.

We can extract the console handle from the process information and
use a 0 value handle to indicate win32 apps that are not attached
to any console.

We cannot compare console handle values directly: without probing
deeper into the handle we don't know that two differently valued
handles refer to different consoles, because a handle can be
duplicated into another with a different numeric value.
2022-01-01 09:40:18 -07:00
Wez Furlong
0bcd770102 docs: note about get_current_working_dir on windows 2022-01-01 09:18:22 -07:00