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

4922 Commits

Author SHA1 Message Date
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
Wez Furlong
240382bcf1 gui: fix fancy tab height
Always match the height of the background strip, which is
2*metrics.height.

refs: #1180
2021-12-24 16:34:45 -07:00
Wez Furlong
8eb7c3cff4 gui: fancy tab bars are now the default
Adjust the rendering and coloring a bit to make the defaults
look pretty reasonable.

refs: #1180
2021-12-24 16:23:01 -07:00
Wez Furlong
ac3cee3fc6 kitty: improve debug when image id is not found
Poking around at an issue, and thinking that some more context
might be nice.

Haven't managed to reproduce the issue so far though :-/

refs: https://github.com/wez/wezterm/issues/1156
2021-12-24 13:19:55 -07:00
Wez Furlong
e3be779477 docs: add basename to get_foreground_process_name examples
refs: #1421
2021-12-24 13:09:31 -07:00
Wez Furlong
4a01bf9bf2 font: improve alpha channel in rasterizer
Previously, we'd set it to 100% if any non-zero channel was present,
but this resulted in stronger/darker outlines that were especially
noticeable when the window background was transparent and over a
bright background.

This commit sets the alpha based on the coverage provided to us
by freetype and looks better with and without a transparent window
background.

@dmfay: I think this might be behind what you noticed in your last
comment on #1025.

refs: #1325
2021-12-24 10:39:33 -07:00
Wez Furlong
88b8cb3e21 term: fix overinvalidation of selection on Windows
Not 100% sure why this only really manifested on Windows, but
the symptoms were:

* Run powershell in a tab
* Run `dir`
* Hit enter a couple of times to show a couple of prompts
* Try using the mouse to select across the prompt boundaries

The selection would get invalidated crossing the boundaries.
I traced this down to the lines around those regions having
SEQ_ZERO as their sequence, so this commit ensures that lines
that are created as part of scrolling the screen are correctly
tagged with the current seqno from the terminal display.

Why only windows? Not totally sure; perhaps it is related to
something funky happening in the conpty layer and sending us
unusual escapes (eg: scroll margins?)
2021-12-24 08:53:49 -07:00