1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00
Commit Graph

153 Commits

Author SHA1 Message Date
Wez Furlong
423b208780 font weight can now be specified as the underlying opentype weight
opentype allows a font to have a weight in the range 0-1000.
MacOS has its own concept of symbolic weight names and opentype
values that is a slightly different scale of boldness to Windows
and Linux.

That means that Medium could be a different range of opentype
weight values depending on the system.

To further complicate things, the font designer can name their
variant with any name they like and assign it an arbitrary
opentype weight value.

For the Operator Mono font, it has Book variant with opentype
weight 325 and a Light variant with an opentype weight of 300.

wezterm was considering these both to have `FontWeight::Light` because
that's how those values were bucketed, which results in amibiguity in
resolve the font and frustration in not being able to access one of the
variants.

This commit changes the `FontWeight` type to now hold the unambiguous
opentype weight value, and to define some symbolic aliases for
some specified weights.

When serializing, if the weight matches a symbolic alias, then that
name will be used in the canonical name (eg: as listed via ls-fonts).
Otherwise, the numeric value will be used.

When parsing the font configuration, wezterm will allow both symbolic
and numeric values.

This allows all of the Operator Mono variants to be referenced
unambiguously, although some variants have to be specified via the
numeric weight:

```
wezterm.font("Operator Mono", {weight=275, stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-XLight.otf, FontDirs
wezterm.font("Operator Mono", {weight="Light", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Light.otf, FontDirs
wezterm.font("Operator Mono", {weight=325, stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Book.otf, FontDirs
wezterm.font("Operator Mono", {weight="DemiLight", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Medium.otf, FontDirs
wezterm.font("Operator Mono", {weight="Regular", stretch="Normal", italic=false}) -- /Users/wez/.fonts/OperatorMono-Bold.otf, FontDirs
```

https://github.com/wez/wezterm/issues/849#issuecomment-873454483
2021-07-04 08:55:08 -07:00
Wez Furlong
c514254138 wayland: use proportional font for title bar
allow specifying the font in the config file
2021-06-27 13:04:20 -07:00
Wez Furlong
ca8209b230 wayland: move frame color config to the config file
This simplifies it a bit and exposes the config via the config file;
the following options are possible, each one specifies a color

```lua
return {
  window_frame = {
    inactive_titlebar_bg = "",
    active_titlebar_bg = "",
    inactive_titlebar_fg = "",
    active_titlebar_fg = "",
    inactive_titlebar_border_bottom = "",
    active_titlebar_border_bottom = "",
    button_fg = "",
    button_bg = "",
    button_hover_fg = "",
    button_hover_bg = "",
  }
}
```

refs: https://github.com/wez/wezterm/issues/761
2021-06-27 12:33:56 -07:00
Wez Furlong
f752d0e7ac set COLORTERM=truecolor in the environment
closes: https://github.com/wez/wezterm/issues/875
2021-06-15 19:34:31 -07:00
Wez Furlong
3ea030794b memoize the renderer used for termwiztermtab and custom tab bars
Create only one, then just clone as needed.

refs: #817
2021-06-13 09:06:29 -07:00
Wez Furlong
cc19aaca9f revise skip_close_confirmation_for_processes_named for Windows
closes: #843
2021-06-10 07:39:00 -07:00
Wez Furlong
cb4da18021 key assignment and docs for ShowDebugOverlay
refs: https://github.com/wez/wezterm/issues/641
2021-05-30 19:56:11 -07:00
Wez Furlong
e29fdae3b9 dead code: remove old FontHinting, FontAntialiasing bits 2021-05-22 15:04:42 -07:00
Wez Furlong
9b082edb8d log errors when a color scheme fails to load
refs: https://github.com/wez/wezterm/issues/794
2021-05-15 13:39:31 -07:00
Wez Furlong
58157c47a9 config: can now subscribe to config change events
This removes a couple of periodic config polls

refs: https://github.com/wez/wezterm/issues/770
2021-05-08 11:06:07 -07:00
Chris
2add312c5c
Allow VoidSymbol keycode to be seen by wezterm (#759)
* allow voidsymbol for key code

* update docs, cleanup

* cleanup and fmt of files

* remove unnecessary inputs
2021-05-07 07:54:24 -07:00
Wez Furlong
0e9d86f9f9 lua: print -> log_info
Make print equivalent to log_info.
Improve the various log functions so that all of their arguments
are considered.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:52 -07:00
Wez Furlong
09f0421b48 add lua repl to the debug overlay
`wezterm` is pre-imported.
The repl prints the result of the expressions to the overlay.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:44 -07:00
Wez Furlong
8b71a57513 add debug overlay
Adds a `ShowDebugOverlay` key assignment that will create a tab
overlay that shows a limited number of recently logged events.

refs: https://github.com/wez/wezterm/issues/641
2021-05-03 09:19:38 -07:00
Wez Furlong
b5f6a79520 add nushell to list of shells 2021-05-01 19:50:31 -07:00
Wez Furlong
82d825ab37 split padding out from truncation
This makes these functions a bit more composable!

Heads up @jankatins; this is a breaking change (for the better!)

refs: https://github.com/wez/wezterm/issues/647
2021-05-01 18:26:53 -07:00
Wez Furlong
8880979586 Adjust font scaling math again
This commit introduces the knowledge about whether a font is
scalable or was using bitmap strikes (eg: color emoji bitmaps).

Then that information is used to help figure out whether and
how to scale a glyph.

refs: https://github.com/wez/wezterm/issues/685
2021-05-01 16:45:57 -07:00
Wez Furlong
9ccdc157a7 fonts: search locator for fallbacks first
Also add an option to control whether we look in font_dirs for fallback.
Previously we would, but it could lead to some surprising fallback
choices.

The default now is to search locator then built-in.

refs: https://github.com/wez/wezterm/issues/685
refs: https://github.com/wez/wezterm/issues/727
2021-05-01 16:45:57 -07:00
Wez Furlong
35eb7383b1 ci: simplify version number
Previously, we used `git describe --tags` to produce a version number
for non-released builds derived from the most recent tag + some info
such as the number of commits since that tag and then `g{HASH}`.

That always confuses people because the date portion at the front
looks old (it is typically the previous release) and the hash at
the end has that `g` in it.

This commit simplifies both the tag name used when making a release
and the computed version number take the date/time from the current
commit, and then append the hash.  That way the version number always
corresponds to a commit.

This scheme doesn't help detect situations where the commit is
dirty, but I don't think the old one would have helped with that
either.
2021-04-29 20:23:47 -07:00
Wez Furlong
c4dc358282 add truncate_left_to_width
refs: #647
2021-04-27 06:23:19 -07:00
Wez Furlong
7e996950f6 add wezterm.truncate_to_width
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 22:27:12 -07:00
Wez Furlong
be9c60bfc8 removed tab_bar_style options in favor of format-tab-title
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 20:16:47 -07:00
Wez Furlong
0f2f3734d9 add wezterm.column_width
refs: https://github.com/wez/wezterm/issues/647
2021-04-26 20:10:27 -07:00
Wez Furlong
3028756ccb add tab_bar_at_bottom config option
closes: https://github.com/wez/wezterm/issues/278
2021-04-25 20:49:48 -07:00
Wez Furlong
8ce376753f round out quick select mode
* Make alphabet and patterns configurable
* add docs
* Enhance scrollback search to support regex captures so that
  searching for eg: `fo(o)` will select the last `o` in `foo`.

refs: https://github.com/wez/wezterm/issues/732
2021-04-25 16:27:39 -07:00
Wez Furlong
5b1631fe21 add quickselect overlay
This is the first pass implementation, drawing on the alphabet logic
and default patterns from tmux-thumbs (thanks @fcsonline!).

ctrl-shift-space pops up the quick select overlay.
Typing the highlighted prefix will select the matching text and
copy it as though the `Copy` key assignment was used.

TODOs are to make the alphabet and patterns configurable, as well
as write up some docs.

refs: #732
2021-04-25 11:52:14 -07:00
Wez Furlong
053cb11e9f improve ssh domain support for ssh_config
This tidies up how we pass the ssh config to the connection ui
logic, by moving the ssh_config setup to the two callers.

A couple of notable adjustments:

* SshDomain::username is now optional; it will default to the
  values computed by the ssh config file loader
* no_agent_auth value wasn't hooked up to anything, but now it is

refs: https://github.com/wez/wezterm/issues/730
2021-04-24 21:56:32 -07:00
Wez Furlong
2c89e47f9e add force_reverse_video_cursor option
refs: https://github.com/wez/wezterm/issues/706
2021-04-24 21:16:58 -07:00
Wez Furlong
e3fcdc9f36 add format-window-title event
This provides a flexible way for users to customize what gets
shown in the window title bar.

closes: https://github.com/wez/wezterm/pull/603
2021-04-24 16:47:26 -07:00
Wez Furlong
e83d059fc7 couple of build tweaks for git versioning and macos build perf 2021-04-23 23:29:43 -07:00
Wez Furlong
d705886b53 Add pane_focus_follows_mouse
closes: https://github.com/wez/wezterm/issues/600
2021-04-23 22:17:33 -07:00
Wez Furlong
657ed92d82 add swallow_mouse_click_on_pane_focus option
refs: https://github.com/wez/wezterm/issues/724
2021-04-23 22:17:06 -07:00
Wez Furlong
76353a6240 fix: InputMap reading global config instead of window overrides
refs: #656
2021-04-16 08:59:49 -07:00
Wez Furlong
1b12b0a23d fonts: improve font_rules behavior
We now always append the synthetic rules to the those in the config,
and include rules for generating half-bright font selection.
2021-04-15 09:43:24 -07:00
Wez Furlong
776aedf97e fonts: allow specifying weight/stretch/italic for each fallback font 2021-04-12 22:30:55 -07:00
Wez Furlong
5ced58c37b Allow disabling re-sorting fallback fonts
The system locator may have a reasonable default ordering
in its list of fallbacks.

refs: #685
2021-04-12 08:03:17 -07:00
Wez Furlong
406d1044fa fonts: restore messaging about missing glyphs
Now that all platforms know whether the system fallbacks
covered the requested glyph range, it is reasonable to
restore the configuration error window to advise the user
if they are missing fonts for the text they want to display.

refs: https://github.com/wez/wezterm/issues/671
2021-04-10 21:35:58 -07:00
Wez Furlong
99fc3ee3cd fonts: rename width/FontWidth to stretch/FontStretch
This terminology is consistent with that used in CSS to describe
this same property of the font.
2021-04-09 12:00:18 -07:00
Wez Furlong
4c1de197bd fonts: use ParsedFont rather than FontDataHandle
This can avoid extraneous parses in a few cases.
2021-04-08 17:11:23 -07:00
Wez Furlong
ecc500af05 ssh: don't override the ssh config User value 2021-04-08 16:17:49 -07:00
Wez Furlong
43ea2f192a Allow matching font weight and font width in wezterm.font
refs: https://github.com/wez/wezterm/issues/655
2021-04-08 15:42:53 -07:00
Wez Furlong
a6ebae3be2 refine reduce_first_font_to_family 2021-04-07 23:48:49 -07:00
Wez Furlong
b03300404a Allow specifying distinct load and render targets
refs: https://github.com/wez/wezterm/issues/639
2021-04-07 12:15:03 -07:00
Wez Furlong
d7c7c27203 config: distinguish between fallback and synthesized fonts
refs: #648
2021-04-05 08:59:24 -07:00
Wez Furlong
b63a949df8 config: fix wezterm.config_dir, add wezterm.config_file
refs: https://github.com/wez/wezterm/discussions/635#discussioncomment-567968
2021-04-04 08:53:50 -07:00
Wez Furlong
fe48951e7a macos: fixup SUPER+SHIFT+[ key decoding
One of the default key assignments was registered as `SUPER+SHIFT+{`
which worked on macOS, but on Linux, would never match because the
keypress over there was (correctly) reporting as `SUPER+{`.

I originally thought that the user reported issue was a linux
normalization problem, but in looking deeper, the issue is really
that macos is doing something funky!

On macos we collect the interpreted key event as a string, and also
the interpretation of that event without any modifiers applied.

For letters this means that eg: `ALT-l` reports as `¬` for the
processed string and `l` for the unmodified string.  That's good!

However, for punctuation we get a backwards result: SUPER+SHIFT+[
produces `[` for the processed text and `{` for the unmodified
text!

This commit tries to detect this, using a heuristic that is
potentially bad on non-US layouts: if both the processed and
unmodified strings are punctuation then we bias to the unmodified
version.

With that change, that key press is correctly reported as `SUPER+{`,
and we can fix the key assignment registration to reflect that.

I quickly checked the behavior of pressing that same physical key
combination with a DEU layout active, and it appears that the unmodified
stuff is also flipped there; we get a lower-case version of something
that I think should be uppercase.  This commit doesn't change that
behavior:

```
key_event KeyEvent { key: Char('ü'), modifiers: NONE,
        raw_key: Some(Char('Ü')),
        raw_modifiers: SHIFT | SUPER,
        raw_code: Some(33),
        repeat_count: 1, key_is_down: true }
```

refs: https://github.com/wez/wezterm/issues/601
2021-04-03 06:32:13 -07:00
Wez Furlong
47e62cc243 Avoid confusing error when the font has no bold/italic variant
refs: https://github.com/wez/wezterm/issues/617
2021-04-02 17:59:27 -07:00
Alex Gartrell
ee4b4b598c Add ActivateLastTab command
This replicates `last-window` in tmux. To pull this off, I
deliberately store the last tab whenever I'm activating a new one or
spawning a new one. I had to do this explicitly rather than hooking
set_active, because we end up setting the active tab briefly for some
common operations like moving a tab.
2021-04-02 09:14:59 -07:00
Wez Furlong
64236c6216 clippy 2021-03-26 09:03:28 -07:00
Wez Furlong
2902a76c5c lint: fix some clippy stuff 2021-03-25 10:05:34 -07:00