1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00
Commit Graph

4778 Commits

Author SHA1 Message Date
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
Wez Furlong
a78ff883a9 windows: query the system caption font
Use this for the tab bar font by default
2021-12-25 09:54:31 -07:00
Wez Furlong
714e74e7af fonts: move computation of title font to wezterm-fonts
Rather than hardcode a fixed default value in the config crate, define
the default as optional and leave it to the font crate to compute
the value.

This is a step towards allow introducing system dependent GUI related
code to resolve/understand the title font: we can't put that directly
in the config crate.
2021-12-25 07:49:46 -07:00
Wez Furlong
a0cbea2703 term: ignore first OSC title change sequence on Windows
ConPTY emits a sequence that sets the title to the name of the
program that is initially launched into it.

This commit tries to ignore that sequence in that circumstance,
so that the logic in b5d156c282
can more dynamically set the tab title.
2021-12-25 01:10:37 -07:00
Wez Furlong
b5d156c282 mux: use pgrp leader basename as default pane title
If the pane title is the default `wezterm`, then return the
process basename instead.  This makes the tab titles more useful
by default, although on Windows, conpty will set the title
to the initial executable path and defeat this.
2021-12-25 00:14:31 -07:00
Wez Furlong
153861a639 config: fix default WindowFrameConfig
There was a discrepancy between leaving it out of the config
and having it partially initialized; fix that up.

Make the default title font size larger on !Windows, as it
looks a bit better.

We might need to make this larger size mac specific.

refs: #1180
2021-12-24 18:49:01 -07:00
Wez Furlong
3a628527b7 gui: fix right width of right status area in fancy tab bar
refs: #1180
2021-12-24 18:07:24 -07:00
Wez Furlong
ebaf49ad6b gui: use first cell bg/fg color for fancy tab bg/fg
refs: #1180
2021-12-24 17:42:01 -07:00