1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-28 09:12:19 +03:00
Commit Graph

6296 Commits

Author SHA1 Message Date
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
Wez Furlong
4c30131a6f lua: expose metrics to lua 2022-07-26 22:33:52 -07:00
Wez Furlong
9559404c3c fix termwiz --all-features build 2022-07-26 21:26:20 -07:00
Wez Furlong
742fe5f462 wezterm.format: now supports rgba colors
```
> wezterm.format{{Background={Color="rgba(255,0,0,0.5)"}}, {Text="wat"}}
"\u{1b}[48:4::255:0:0:127mwat\u{1b}[49m"
```
2022-07-26 21:12:12 -07:00
Wez Furlong
6e9a22e199 termwiz: allow setting alpha for SGR fg, bg attributes
This commit extends the sgr color parser to support a wezterm
extension that I just made up:

```
printf "\e[48:4:255:0:0:60mhello\e0m"
```

The `4` is wezterm specific and denotes 4 channel color, in this case
RGBA. red is 255, green is 0, blue is 0 and alpha is 60; the values are
interpreted as u8 values.

CSI 38 (fg), 48 (bg) and 58 (underline) support this.

refs: https://github.com/wez/wezterm/issues/2313
2022-07-26 21:05:18 -07:00
Wez Furlong
bc083ee470 termwiz: ColorSpec now allows for alpha to be tracked
This doesn't really change any behavior, but adjusts the types
such that CSIs that set colors have the potential to track the
alpha channel and that can make it through to the GUI/render layer.
2022-07-26 19:39:53 -07:00
Wez Furlong
cb89f2c36e allow setting alpha for OSC 10, 11, 12
refs: https://github.com/wez/wezterm/issues/2313
2022-07-26 19:02:47 -07:00
Wez Furlong
858bc3ccce term: avoid panic in phys_row when row is out of range
Just clamp it to the current physical, non-scrollback portion
of the screen.

This avoids a panic but doesn't address the screen size mismatch
in the associated issue.

refs: https://github.com/wez/wezterm/issues/2133
2022-07-26 09:40:44 -07:00
Wez Furlong
e7c7ea20f6 deps: harfbuzz -> 5.0.1 2022-07-26 09:09:46 -07:00
Wez Furlong
1d64071609 tabs: revise active index after killing panes
refs: #2304
2022-07-26 08:25:31 -07:00
Wez Furlong
2e0467d121 deps: zstd 0.6 -> 0.11 2022-07-25 21:29:43 -07:00
Wez Furlong
a25a87c393 docs: fix typo in changelog 2022-07-25 21:15:31 -07:00
Wez Furlong
5e6ce47330 fix "no pane" tab hang when two panes close at once
There was a race condition where we could leave the tab
active index pointing to the wrong pane.

That meant that the tab information computed by the gui
layer would see no panes marked as active, and thus would
end up with no active tab.

This commit fixes that by clamping the active index to
the number of panes.

refs: https://github.com/wez/wezterm/issues/2304
2022-07-25 21:06:24 -07:00
Wez Furlong
39adbb984d Pane::search: expose range, limit. Limit quickselect by default
The recent work on the scrollback made it easier to constrain the
search region, so expose those parameters to the Pane::search
interface and to the mux protocol.

Use those new parameters to constrain quickselect search to
1000 rows above and below the current viewport by default, and
add a new parameter to QuickSelectArgs that allows overriding that
range.

A follow-up commit could make the search/copy overlay issue a series
of searches in chunks so that it avoids blocking the UI when
searching very large scrollback.

refs: https://github.com/wez/wezterm/pull/1317
2022-07-25 18:31:27 -07:00
Wez Furlong
360b3f3479 ci: try uploading sha256 files alongside release assets
refs: #2114
2022-07-25 08:39:24 -07:00