1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 02:25:28 +03:00
Commit Graph

6160 Commits

Author SHA1 Message Date
Wez Furlong
e4435938a8 add window:set_left_status
refs: https://github.com/wez/wezterm/issues/1561
2022-08-06 20:41:39 -07:00
Wez Furlong
28d803e3f4 refine dual source blending / subpixel aa and RGBA color interaction
Previously, we'd unconditionally enable dual source blending for the
text foreground layer when rendering. That meant that if the user had
configured the fg color to include an alpha value it would get "stamped
through" the draw all the way to the background, making that whole pixel
take on that alpha value rather than allowing it to blend through the
way you might expect.

In prior releases that didn't matter, but since we now allow configuring
the fg color with alpha, and allow using escape sequences to set the fg
for a span to something with alpha, there is now a much higher chance of
something looking weird.

Dual source blending is only really needed for subpixel-aa and that
isn't enabled by default.

This commit changes the behavior to use regular alpha blending if the
main config (rather than a per-font override) hasn't set the freetype
load/render target to one that enables subpixel-aa.

That means that alpha channel values work as expected for fg color
by default.

If you want to enable subpixel-aa you need to enable it globally
and be aware that it will cause weirdness when trying to use alpha
channels for the fg text color.

The docs now also indicate this behavior.

This limitation could be removed by making text rendering significantly
more complex and I don't fancy doing that at this time.
2022-08-06 17:41:44 -07:00
Wez Furlong
4c1fd693b4 fix positioning of visual bell
refs: https://github.com/wez/wezterm/issues/2364
2022-08-06 13:42:28 -07:00
Wez Furlong
3941d2a564 boxmodel: fix missing bearing_x / x_offset
Fixes up horizontal positioning in the fancy tab bar and spacing
in tab titles in some cases.

refs: https://github.com/wez/wezterm/issues/2357
2022-08-06 12:46:54 -07:00
Wez Furlong
3e298dc63a add wezterm ls-fonts --rasterize-ascii --text foo
This renders the glyph in ascii blocks, and shows some
additional data about the glyphs.
2022-08-06 12:46:01 -07:00
Wez Furlong
ef532fc7e5 mux: adjust window size after attach
Since the initial attach is async, we'd create the window at the
default/initial size and then never reconcile the size of the remote
tabs once they'd attached.

This commit introduces an event that allows the gui window to do that.

The action that it takes is to take the max width and height between
its current size and the size of a newly added tab and resizes to
that new size, if it changed.

refs: https://github.com/wez/wezterm/issues/2133
refs: https://github.com/wez/wezterm/issues/2351
2022-08-05 07:53:44 -07:00
Wez Furlong
1212865974 use titlebar bg for right status background
We were using the tab background, which is a bit awkward.

refs: https://github.com/wez/wezterm/issues/2356
2022-08-04 20:45:05 -07:00
Wez Furlong
d5b910abed docs: clarify that we might be showing more recent info
for copy mode and search mode
2022-08-04 06:31:40 -07:00
Wez Furlong
3f7443f4c1 showkeys/docs: generate copy_mode defaults from the code
Uses `wezterm show-keys --lua --key-table copy_mode` to dump the
actual copy mode key table.  Include that in the docs.

Same for search_mode.
2022-08-04 06:28:32 -07:00
Wez Furlong
9cce9ff81b fix potential panic when computing hyperlink rules
refs: https://github.com/wez/wezterm/issues/2355
2022-08-03 21:34:12 -07:00
Wez Furlong
7d01d3f683 docs: a bit more detail for RGBA sequences
refs: https://github.com/wez/wezterm/issues/2313
2022-08-03 21:10:00 -07:00
Wez Furlong
decde7c3be wezterm show-keys --lua to print a lua version of the config
This is handy for eg: copying and pasting out the default config.

I think I'll use this to update some parts of the docs in a more
automated fashion.
2022-08-03 18:14:00 -07:00
Wez Furlong
dfe4d8cb79 docs: update wezterm.font
Consolidate the attributes together rather than having them in separate
versioned sections so that it is a bit more readable.

Make a note about how attributes select from existing fonts rather than
apply styling effects to fonts.

refs: https://github.com/wez/wezterm/issues/2348
2022-08-03 08:55:56 -07:00
Wez Furlong
c222c7956f docs: changelog for #2352 2022-08-03 08:24:30 -07:00
aznhe21
63d5c00af9 Add new action CopyMode('ClearSelectionMode') 2022-08-03 08:21:04 -07:00
Wez Furlong
fa6fd959e0 prune flatpak dirs out of gitignore
I moved the repo and state dir out the git repo
2022-08-03 07:04:51 -07:00
Wez Furlong
9c75292450 flatpak: use /.flatpak-info file to test if we are in flatpak sandbox 2022-08-03 07:04:31 -07:00
Wez Furlong
c0ebd2d131 flatpak: refine build; install more executables in image 2022-08-03 07:04:31 -07:00
Wez Furlong
404d742c14 Teach wezterm how to spawn programs when running in flatpak
This commit allows wezterm to spawn programs into the host rather
than in the container environment.

It feels weird that it is so trivial to "break out" of the container
sandbox, but I'm not complaining.

There are some unfortunate consequences:

* there is no `wezterm` installed on the host, so no ability to `wezterm
  cli` to control it from other apps
* The unix domain socket is scoped inside the sandbox, so there's "no
  way" for `wezterm cli` to reach inside anyway.

But: with this, it is at least usable to start a flatpak and open a
shell.

refs: https://github.com/wez/wezterm/issues/2229
2022-08-03 07:04:31 -07:00
Wez Furlong
3379a2b285 flatpak builder
Run `ci/flatpak.sh` to build a flatpak of just the gui.
Run it via flatpak run org.wezfurlong.wezterm

refs: https://github.com/wez/wezterm/issues/2229

Thanks to: @Imxset21
2022-08-03 07:04:31 -07:00
Wez Furlong
1df1f166ca copy mode: move by semantic zone, select by zone
Allows the following assignment actions; I was just over-using z for
no real reason, I'm not suggesting that these are good assignments.

```
      -- move the cursor backwards to the start of the current zone, or
      -- to the prior zone if already at the start
      { key = 'z', mods = 'NONE', action = act.CopyMode 'MoveBackwardSemanticZone' },
      -- move the cursor forwards to the start of the next zone
      { key = 'Z', mods = 'NONE', action = act.CopyMode 'MoveForwardSemanticZone' },
      -- start selecting by zone: both the start point and the cursor
      -- position will be expanded to the containing zone and the union
      -- of those two will be used for the selection
      {
        key = 'z',
        mods = 'CTRL',
        action = act.CopyMode { SetSelectionMode = 'SemanticZone' },
      },
      -- like MoveBackwardSemanticZone by only considers zones of the
      -- specified type
      { key = 'z', mods = 'ALT', action = act.CopyMode { MoveBackwardZoneOfType ='Output' }},
      -- like MoveForwardSemanticZone by only considers zones of the
      -- specified type
      { key = 'Z', mods = 'ALT', action = act.CopyMode { MoveForwardZoneOfType ='Output' }},
```

refs: https://github.com/wez/wezterm/issues/2346
2022-08-02 21:56:53 -07:00
Wez Furlong
33866dad70 termwiz: fix min version dep on winapi. publish 0.17.1
Need at least 0.3.5 (I think) for the type used in
https://github.com/wez/wezterm/pull/2349 as well as the impl-default
feature.

refs: https://github.com/markbt/streampager/issues/57#event-7110671310
2022-08-02 18:21:49 -07:00
Mateusz Kwapich
edbc98304b [termwiz] add impl-default feature to winapi dep to fix the build
Without the feature the build fails with:

    --> src\escape\apc.rs:377:57
     |
377  |         let mut memory_info = MEMORY_BASIC_INFORMATION::default();
     |                                                         ^^^^^^^ function or associated item not found in `MEMORY_BASIC_INFORMATION`
     |
2022-08-02 13:29:05 -07:00
Wez Furlong
119c2f1d0b macos: add bluetooth entitlement
refs: https://github.com/wez/wezterm/issues/2330
2022-08-01 21:26:27 -07:00
Wez Furlong
673ca3ad07 color types version bump for crates.io 2022-08-01 18:41:52 -07:00
Wez Furlong
56de27c773 bidi version bump for publish to crates.io 2022-08-01 18:38:44 -07:00
Wez Furlong
355b6d835b prep for publishing wezterm-bidi and wezterm-dynamic to crates.io 2022-08-01 18:35:56 -07:00
Wez Furlong
edeae72b5f termwiz: bump version to 0.17 2022-08-01 18:31:43 -07:00
Mark Juggurnauth-Thomas
40df2f14d2 termwiz: ensure ST sequence is grouped with OSC
When `parse_first_as_vec` is parsing an OSC sequence (e.g.
`SetHyperlink`) that is terminated by the escaped form of ST (`ESC \`),
ensure that the ST sequence is included in the returned vector.

This is achieved by ensuring the VTParser has returned to the "ground"
state: i.e. the stored state after the `ESC` is processed is not enough
for `parse_first_as_vec` to terminate.  We must also parse the `\` to
ensure that we return a complete span to the caller.

Fixes https://github.com/markbt/streampager/issues/57
2022-08-01 18:30:04 -07:00
Mark Juggurnauth-Thomas
cb0822e40f vtparse: version bump 2022-08-01 18:30:04 -07:00
Mark Juggurnauth-Thomas
94e8325023 vtparse: add method to determine ground state
Add `VTParser::is_ground`, which is true if the VTParser is in the
"ground" state, i.e. it has no stored state that will affect the
interpretation of future input characters.
2022-08-01 18:30:04 -07:00
Davide Cavalca
d03742ff2d bidi: update license tag to match the actual license 2022-08-01 09:26:56 -07:00
Wez Furlong
cab7feb48c deps: update serde_yaml 2022-07-31 20:37:19 -07:00
Wez Furlong
a808b0645d cargo update 2022-07-31 20:14:19 -07:00
Wez Furlong
b72ff966a1 fix typo 2022-07-31 17:58:41 -07:00
Wez Furlong
0d51a9c444 Add cursor and pane position info to wezterm cli list data
This is included only in the json output mode.

Note that this does not and cannot include positioning information known
only to the GUI, as there may not be a GUI. That means that window
position, tab bar and padding data are not known and not able to be
returned via this interface.

```
; wezterm cli list --format json
[
  {
    "window_id": 0,
    "tab_id": 0,
    "pane_id": 0,
    "workspace": "default",
    "size": {
      "rows": 24,
      "cols": 80,
      "pixel_width": 1040,
      "pixel_height": 672,
      "dpi": 124
    },
    "title": "wezterm cli list --format json -- wez@foo:~",
    "cwd": "file://foo/home/wez/",
    "cursor_x": 0,
    "cursor_y": 2,
    "cursor_shape": "Default",
    "cursor_visibility": "Visible",
    "left_col": 0,
    "top_row": 0
  }
]
```

refs: #2319
2022-07-31 12:01:34 -07:00
Wez Furlong
aed0e3ebf8 populate pixel dims + dpi in PaneEntry
This makes those fields usable in `wezterm cli list --format json`.

This doesn't change the ABI of the mux protocol, but prior to
this commit, those fields were always 0.

refs: #2319
2022-07-31 11:25:39 -07:00
Wez Furlong
7dda063c27 update harfbuzz to 5.1.0 2022-07-31 10:53:25 -07:00
Wez Furlong
4485b2966f mouse bindings: remove WheelUp/Down aliases
They prevented using other types of mouse events!

We don't have a good way to specify that kind of alias, so for now,
take it out and replace the examples in the docs with the more verbose
equivalents.

refs: #2173
refs: #2296
2022-07-31 09:33:42 -07:00
Wez Furlong
bd846975fa allow wheel events with no mods. allow mouse events in mouse reporting mode
Adjusts how mouse events are matched so that we can now indicate whether
mouse reporting and alt-screen should be considered as part of the event
trigger criteria.

refs: #2173
refs: #581
2022-07-31 09:15:02 -07:00
Wez Furlong
3db7e72e54 docs: format 2022-07-31 09:11:51 -07:00
Funami580
9346a07d84 docs: add window:current_event() and add scroll events to mouse docs 2022-07-31 07:10:56 -07:00
Funami580
cf423dc614 lua: WheelUp and WheelDown support for mouse_bindings 2022-07-31 07:10:56 -07:00
Bruno Roque
ae2e78d87c
Document CopyMode/QuickSelect Colors (#2324)
* Document CopyMode/QuickSelect colors

* Remove irrelevant line

* Update docs/config/appearance.md

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* Update docs/config/appearance.md

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* Add note on copy_mode_active_highlight_*/selection_*

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2022-07-29 18:00:03 -07:00
Bruno Roque
5a0935626c Update rust by example url 2022-07-29 13:18:53 -07:00
Wez Furlong
b1c60ba258 termwiz: add test cases for parse_first_as_vec w/ OSC+ST
refs: https://github.com/markbt/streampager/issues/57
2022-07-29 06:40:26 -07:00
Wez Furlong
10121790df copy mode: pressing v while in v mode toggles off v mode. Add yank.
refs: https://github.com/wez/wezterm/discussions/2246
refs: https://github.com/wez/wezterm/issues/993#issuecomment-1118512595
2022-07-29 05:00:35 -07:00
Wez Furlong
7e3b35303c gui: allow specifying colors for copy mode and quickselect
refs: https://github.com/wez/wezterm/issues/2320

```lua
return {
  colors = {
    copy_mode_active_highlight_fg={Color="red"},
    copy_mode_active_highlight_bg={Color="blue"},
    copy_mode_inactive_highlight_fg={AnsiColor="Black"},
    copy_mode_inactive_highlight_bg={AnsiColor="White"},
    quick_select_label_fg={Color="white"},
    quick_select_label_bg={Color="blue"},
    quick_select_match_fg={Color="grey"},
    quick_select_match_bg={Color="skyblue"},
  }
}
```
2022-07-28 17:54:07 -07:00
Wez Furlong
718a021817 termwiz: use 6 for the rgba colorspace
`4` is actually defined as CMYK according to ITU-T Rec. T.416:

> A parameter substring for values 38 or 48 may be divided by one or more separators (03/10) into parameter elements,
> denoted as Pe. The format of such a parameter sub-string is indicated as:
>
>     Pe : P ...
>
> Each parameter element consists of zero, one or more bit combinations from 03/00 to 03/09, representing the digits
> 0 to 9. An empty parameter element represents a default value for this parameter element. Empty parameter elements at
> the end of the parameter substring need not be included.
>
> The first parameter element indicates a choice between:
>
> 0    implementation defined (only applicable for the character foreground colour)
> 1    transparent;
> 2    direct colour in RGB space;
> 3    direct colour in CMY space;
> 4    direct colour in CMYK space;
> 5    indexed colour.

refs: 6e9a22e199 (commitcomment-79669016)
2022-07-28 17:09:15 -07:00
Wez Furlong
c7c81e3161 really fix termwiz --all-features build 2022-07-26 22:35:49 -07:00