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

4885 Commits

Author SHA1 Message Date
Wez Furlong
80d16574e3 mux: refactor sysinfo. Use own fn for macos foreground process path
I noticed that sysinfo failed to yield info about 50% of the time on
macos!

Just go direct to the underlying system function; we don't need all
of the info that sysinfo collects in any case.
2021-12-31 11:30:10 -07:00
Wez Furlong
09e8d7b92f mux: proc_pidinfo is now available in libc on macos
So we don't need our own copy of the ffi bits here
2021-12-31 11:09:43 -07:00
Wez Furlong
43dff29391 Sync with iTerm2-Color-Schemes
Sync with:
555db64e47

and update the screenshots for the docs
2021-12-31 10:43:30 -07:00
Wez Furlong
0184038c55 gui: invalidate window after window:perform_action
closes: #1475
2021-12-31 10:02:15 -07:00
Wez Furlong
52c198ab8c x11: default use_ime=true, add xim_im_name option 2021-12-31 09:55:17 -07:00
Wez Furlong
d031342b72 macos: avoid unrecognized selector error
I saw this when the IME was active:

```
2021-12-31 00:46:26.941 wezterm-gui[46160:16665949] -[NSConcreteMutableAttributedString UTF8String]: unrecognized selector sent to instance 0x600002b24180
```

the issue is that some of the window callbacks can receive either
NSString or NSAttributedString.  The latter doesn't have a UTF8String
method, but does have a string property that returns an NSString
that can be used instead.
2021-12-31 00:54:52 -07:00
Wez Furlong
143f7c9acc macos: detect when IME swallows a key press (eg: F8, F9)
Certain keys are "handled" by the IME through it generating a "noop"
command.

That's not super useful for us, so this commit detects the noop case
and then treats it as though the IME didn't handle the input event.

While implementing the above fix, I realized that the same technique
could be used more generally to return processing to our main input
handling for the various selectors that we do recognize: we were
essentially inferring the original key combinations based on the
selector which is not scalable and potentially lossy.

We can't capture CTRL-ESC this same way, as that key combination
is magical and is routed to the callback without generating any
key events.

refs: https://github.com/wez/wezterm/issues/615
refs: https://github.com/wez/wezterm/issues/975
refs: https://github.com/wez/wezterm/pull/1410
2021-12-30 22:50:26 -07:00
Wez Furlong
e3afdd7b8f macos: normalize Composed("p") -> Char('p') when use_ime=true
When the IME is enabled, pressing `CTRL-A P` would generate
`Composed("P")` for the second key press, which we couldn't
then match in the keymapping layer.

This commit checks for that and normalizes it to `Char('P')`
instead.

refs: https://github.com/wez/wezterm/issues/1409
refs: https://github.com/wez/wezterm/issues/1410
2021-12-30 21:36:25 -07:00
Wez Furlong
7efc6a6cb8 gui: ensure that the tab bar occupies a full pixel height
Otherwise we get weird vertical misalignment effects in the
terminal cell area for eg: the top of a `z` glyph being drawn
at a half pixel height.
2021-12-30 20:06:05 -07:00
Wez Furlong
1e7d552844 fonts: replace font_ptr with a font id
I'm running down a weird thing where the main font renders weirdly
when the title font is 12 pt vs the main font 10 pt.

I thought there might have been a cache invalidation issue and
realized that we could have an A-B-A style issue with the font_ptr
stuff, so I replaced it with an incrementing id.

That didn't fix the thing I was looking at, but does feel a bit
nicer overall.
2021-12-30 19:09:30 -07:00
Wez Furlong
a322c3e8d2 fonts: title fonts now fall back to main font list 2021-12-30 18:28:49 -07:00
Wez Furlong
cbe0bc21dc gui: fonts: just use Roboto for default title font on all systems 2021-12-30 18:10:25 -07:00
Wez Furlong
00a393b3d1 gui: bundle and use Roboto for title font on Linux + Windows
The default we use on macOS looks decent.  Roboto is a similar
looking font that we can use for the other platforms.
I may make it the same on all three once I've had a chance
to compare it on a mac.
2021-12-30 17:51:22 -07:00
Wez Furlong
e225589b05 mux: improve process name cache and fg proc name on windows
Reduce the cache lifetime a bit, and resolve a potential
racy/non-deterministic result due to the timestamp granularity.
2021-12-30 17:17:28 -07:00
Wez Furlong
97c8cda974 gui: ls-fonts: include title font in ls-fonts output 2021-12-30 16:51:30 -07:00
Wez Furlong
561efcb8d1 gui: invalidate fancy tab bar on config reload
Otherwise we won't pick up font changes as quickly
2021-12-30 16:50:44 -07:00
Wez Furlong
99d73baba7 docs: changelog for https://github.com/wez/wezterm/issues/1474 2021-12-30 09:37:40 -07:00
Wez Furlong
07af7e0c4b gui: constrain fancy tab size to fit the width
closes: https://github.com/wez/wezterm/issues/1470
2021-12-30 09:20:51 -07:00
Wez Furlong
c68b55ba4f termwiz: clamp grapheme column width to 2
This isn't ideal, but it addresses a couple of issues:

* wezterm currently has a debug assertion that this is true
* Korean text in NFD is currently recognized as having a width of 3
  when it should be 2 due to upstream issue
  https://github.com/ridiculousfish/widecharwidth/issues/16
* NFD and NFC should render the same for the sample text in
  https://github.com/wez/wezterm/issues/1474 but don't as a result

Clamping to 2 "solves" these, at the cost of potentially other
weird stuff in the future.  It seems like a reasonable tweak
for the time being!

refs: https://github.com/wez/wezterm/issues/1469
refs: https://github.com/wez/wezterm/issues/1474
refs: https://github.com/ridiculousfish/widecharwidth/issues/16
2021-12-29 21:38:33 -07:00
Wez Furlong
b1bc74d31f logo: refine appearance a bit more
This commit switches back to wezterm-icon.svg as the source of
the icon, but modifies it:

* Removed mac style title bar + window manipulation icons
* Increases the corner radius
* Adjusts the text position and size

This makes it somewhere between the original and one of the alternate
icons in 98b71cbfb6

I chose to modify the original source as it didn't have padding
baked into the svg file, and I didn't feel like wrestling with
the contributed svg in inkscape to remove it.
2021-12-29 18:14:26 -07:00
Wez Furlong
98b71cbfb6 rename contributed icons
The spaces are awkward to work with from the terminal
2021-12-29 17:24:24 -07:00
Wez Furlong
f175c5f6c0 add wezterm.get_builtin_color_schemes() 2021-12-29 09:20:12 -07:00
Wez Furlong
e5dd859ecc gui: tidy up metrics/line widths for X and + tab bar buttons 2021-12-29 09:00:50 -07:00
Wez Furlong
5608e9477b termwiz: make seqno a required param for Line
Previously, we would implicitly set it to the special SEQ_ZERO
value, but since that value always flags the row as changed,
it causes some over-invalidation issues downstream in wezterm.

This commit makes that parameter required, so that the code that
is creating a new Line always passes down the seqno from that event.

refs: #1472
2021-12-29 08:34:59 -07:00
Wez Furlong
93a9b5a7fe gui: add Poly content drawing to box model; use it for x and + buttons
This should make those buttons look a bit more consistent
2021-12-28 23:24:18 -07:00
Wez Furlong
74caa9c173 gui: fixup bottom alignment of tab bar buttons 2021-12-28 21:53:08 -07:00
Wez Furlong
add3863871 gui: add x close button in fancy tabs
closes: #1351
2021-12-28 19:15:45 -07:00
Wez Furlong
494a0983ee gui: cache shaping and layout of fancy tab bar, allow placing at bottom
We only need to recompute when the tab content changes, or when
the window is resized, plus invalidations of the shape cache
of texture atlas filling up.

Hover events don't need to re-shape.

We can now also place the tab bar at the bottom of the screen again.
2021-12-28 12:29:54 -07:00
Wez Furlong
cc2bbced82 gui: respect tab background color
The main tab area now takes the background color from the first
cell in a formatted tab bar item as the full background color
for the whole tab area, which looks a lot nicer than just the
using that color for the minimal bounding box of the tab text.
2021-12-28 10:10:13 -07:00
Wez Furlong
f92d8112ae gui: avoid seeing right-status underneath left tabs when window is small
Introduce an opaque container to hold the left items and have that
sit over the top of the floated right status area to make things
look cleaner.
2021-12-28 09:22:16 -07:00
Wez Furlong
4ca7514029 gui: tighten up fancy tab bar to 1.75 line height
Add bottom alignment for tabs and make them slightly shorter
than the right status area; this avoids some pixel gaps.
2021-12-28 08:51:09 -07:00
Wez Furlong
13ac944e7f cargo fmt
refs: #1468
2021-12-28 08:50:43 -07:00
Wez Furlong
6ac6ac45b6 lua: add pane:get_logical_lines_as_text
refs: #1468
2021-12-28 08:04:41 -07:00
Wez Furlong
96dd41c5c5 window: update smithay-client deps 2021-12-28 07:28:07 -07:00
Wez Furlong
f4fab10e69 gui: box model style layout/render for fancy tab bar
This commit adds a CSS box model inspired element / layout
facility, and replaces the hand implemented fancy tab bar
element render.

This makes the code for fancy tab bar much easier to read
and update.

The right status area now expands to the full height of the
tab bar area, and uses a line height of 2.0, which makes
it line up nicely in the tab bar.
2021-12-28 00:14:54 -07:00
Wez Furlong
8c7072c5ef gui: flesh out test case for wsl -l -v
closes: https://github.com/wez/wezterm/issues/1462
2021-12-27 10:39:26 -07:00
Wez Furlong
780756bea8 gui: don't warn about wsl helper function on unix
Technically is only used on windows, but I'm fine with having
it built and tested on all platforms.
2021-12-27 10:35:11 -07:00
Wez Furlong
ae9a47e8a6 fix unix build for zbus updates 2021-12-27 10:33:41 -07:00
Wez Furlong
7e90a7008c deps: update pulldown_cmark, cargo update 2021-12-27 09:49:22 -07:00
Wez Furlong
4cf90bf7a1 gui: avoid invalidating window when only a modifier key is held down 2021-12-26 12:58:14 -07:00
Wez Furlong
2464e8fb3a gui: use wsl -l -v output for launcher items
Switch to the slightly more structured verbose output of `wsl -l -v`
in the hope that we are less prone to localization issues and
are more robust in the face of future changes.

refs: #1462
2021-12-26 09:19:38 -07:00
Wez Furlong
d51ce704d9 gui: don't use win32 gui subsystem in test configuration
We won't see test output in that case, because the tests won't
be able to write to the console!
2021-12-26 09:16:22 -07:00
Wez Furlong
2e24b0fc22 gui: improve new tab button appearance for fancy tab bar 2021-12-26 08:21:09 -07:00
Wez Furlong
910ad5edb7 mux: add cache around sysinfo
This limits sysinfo process info updates to once per second,
which should help keep tab titles snappier.
2021-12-25 23:15:08 -07:00
Wez Furlong
790b515c21 gui: allow mouse wheel to route to hovered pane
refs: https://github.com/wez/wezterm/issues/798
2021-12-25 15:37:14 -07:00
Wez Furlong
c937f0c77c cargo fmt 2021-12-25 14:01:36 -07:00
Wez Furlong
a1ff2d6415 gui: make another pass over focus/mouse event routing
refs: #1437
2021-12-25 13:59:23 -07:00
Wez Furlong
5bf366f8be logo: crop out padding for linux and windows icons 2021-12-25 13:04:55 -07:00
Wez Furlong
56420205e9 gui: fix over-opacity with split panes and transparent windows
closes: #1459
2021-12-25 12:20:40 -07:00
Wez Furlong
c4257ab8d6 config: fix asymmetric serialization of keycode and modifiers
This adds string serialization for the keycode and modifiers as
used in the config.

We can't simply tell the base types to serialize in this form because
we may serialize and pass those via the mux protocol and the default
derived serializers are more efficient for that purpose.

This allows:

```lua
local wezterm = require 'wezterm'

return {
  keys = {
    {key="a", mods="ALT", action=wezterm.action{SendKey={key="b"}}}
  },
}
```

to parse: previously, wrapping `SendKey` in `wezterm.action` would fail
to round-trip the the `SendKey` and lead to an error loading the
config.
2021-12-25 12:11:59 -07:00