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

850 Commits

Author SHA1 Message Date
Wez Furlong
9b67a71485
add wezterm cli get-pane-direction
refs: https://github.com/mrjones2014/smart-splits.nvim/issues/53
2023-04-05 07:00:49 -07:00
Wez Furlong
336fefb52f
Add PromptInputLine and examples of (re)naming tabs/workspaces
refs: https://github.com/wez/wezterm/issues/522
refs: https://github.com/wez/wezterm/issues/1598
2023-04-04 21:11:08 -07:00
Wez Furlong
11dc59b613
mux: explicitly update tab/pane active status on focus change
Previously, we'd record the focused pane only in the per-client
view.

That status didn't propagate through the model fully, leading to
inconsistencies when using activate-pane-direction.

This commit does the full model update to force that through.
I may regret this later: the focus state was intended to be
a per-client attribute and this effectively prevents that
from ever being useful.

Maybe the per-client state should just be removed?
Will ponder that later.

refs: https://github.com/wez/wezterm/issues/3448
refs: https://github.com/wez/wezterm/issues/3387

Also sneaking in here is not updating the last input time
for a client unless the input was taken by a user.
2023-04-04 17:31:35 -07:00
Wez Furlong
4be2b9dbeb
make config_builder work with table.insert(config.keys, ...)
This had a referencing issue, similar to the more recent GLOBALS
issue.

The resolution in this case is a lot simpler: we can just return
a regular lua table and use all the same underlying semantics,
but stick a metatable over the top to handle assignment and
provide the strict mode method.
2023-04-04 11:43:21 -07:00
Wez Furlong
8ddd0d986d
mux: spawn: only use the cwd from a pane in a compatible domain
If the target domain_id doesn't match the source pane.domain_id(),
then we consider the filesystem namespace to be incompatible and
won't try to use it.

refs: https://github.com/wez/wezterm/issues/3442
2023-04-03 22:46:17 -07:00
Wez Furlong
e28b3cec4e
mux: fix unseen output status for remote panes
refs: #2625
2023-04-03 21:12:18 -07:00
Wez Furlong
ad953c535e
docs: changelog for #1872 2023-04-03 20:37:10 -07:00
Wez Furlong
c3472cc969
ssh: fix token expansion for ProxyCommand
refs: https://github.com/wez/wezterm/issues/3437
2023-04-03 17:04:53 -07:00
Wez Furlong
49296500da
mux: forward ClearScrollback requests to remote server
refs: #2624
2023-04-02 14:17:05 -07:00
Wez Furlong
3dc2ac0a75
fix wezterm connect --workspace
When creating the initial window, we didn't pass through the
provided workspace name.

refs: #2734
2023-04-02 14:04:20 -07:00
Wez Furlong
b853d00cff
mux: detach domain on window close
refs: #2644
2023-04-02 13:35:12 -07:00
Wez Furlong
50172f2e88
add wezterm.mux.rename_workspace
refs: #2787
2023-04-02 08:03:07 -07:00
Wez Furlong
741570563d
add wezterm cli rename-workspace
refs: #2787
2023-04-02 07:37:45 -07:00
Wez Furlong
000269261b
add wezterm cli set-tab-title and wezterm cli set-window-title
refs: #1598
refs: #522
2023-04-01 23:00:00 -07:00
Wez Furlong
dd7d22ed6b
mux: propagate tab and window title when it changes
refs: #1598
2023-04-01 21:31:37 -07:00
Wez Furlong
ea28fb891a
add window:active_tab(), window:active_pane(), tab:active_pane() 2023-04-01 19:46:15 -07:00
Wez Furlong
8582165ffc
add display_pixel_geometry config option for subpixel geometry
refs: #3422
2023-04-01 11:05:09 -07:00
Wez Furlong
a7052cb188
docs: changelog for #2722
refs: #2722
2023-03-31 23:10:12 -07:00
Wez Furlong
74da631430
mux: allow client to provide palette to mux server
The server-side ownership of the palette is a stumbling block for
many users, so let's fix it.

This commit allows the client to pass its configured palette to
the server when it connects, and when the config is changed.

That palette takes precedence over the palette from the server config.

However, if the remote application uses any escape sequences that
redefine the color palette, the color palette that was active at
that point in time is forked and use as the basis, and will remain
the active palette until the palette is reset via escape sequences.

refs: https://github.com/wez/wezterm/issues/2686
refs: https://github.com/wez/wezterm/issues/3397
2023-03-31 08:02:32 -07:00
Wez Furlong
d1c2257bd8
macos: fix CTRL key behavior when use_ime=true
refs: https://github.com/wez/wezterm/pull/2435
refs: https://github.com/wez/wezterm/issues/2771
refs: https://github.com/wez/wezterm/issues/2630
2023-03-30 21:49:48 -07:00
Wez Furlong
76060b7cc2
win:perform_action now works with Copy Mode and other overlays
refs: #3209
2023-03-30 19:46:02 -07:00
Wez Furlong
4a555be7d9
gui: win:perform_action now awaits the underlying perform_key_assignment
This should help a bit with https://github.com/wez/wezterm/issues/3405
even though there is a better solution for the scenario mentioned there.
2023-03-30 19:31:40 -07:00
Wez Furlong
c766d5e465
fix is_zoomed property in tab:get_panes_with_info()
refs: #3404
2023-03-30 07:44:38 -07:00
Wez Furlong
e9feb578c8
docs: cover new default ssh domain behavior and function 2023-03-29 21:01:54 -07:00
Wez Furlong
1e688a5128
Add serial_ports config
This commit teaches the config about SerialDomains, and the mux
layer about constructing a SerialDomain, then changes the GUI
layer to use those pieces to set up `wezterm serial`.

A new `serial_ports` config is added, and the GUI layer knows how
to apply it to the set of domains in the mux.

The result of this is that you can now define a domain for each
serial port and spawn a serial connection into a new tab or window
in your running wezterm gui instance.
2023-03-29 19:05:13 -07:00
Wez Furlong
338174b430
mux: fix pid file locking
This got broken around the time we started to re-exec the mux
server.  Since the fd was CLOEXEC we'd essentially unlock and
ignore the lock at the point we'd re-exec.

This commit allows the fd to remain open and locked across
the exec, and causes the exec'd process to set CLOEXEC by
explicitly telling it about the log fd, so that shells and
things spawned by the mux don't hold the lock.
2023-03-29 06:10:11 -07:00
Wez Furlong
ea92df9486
mux server: propagate config CLI options when daemonizing
refs: #3397
2023-03-29 05:40:15 -07:00
Wez Furlong
90fc554035
docs: changelog for https://github.com/wez/wezterm/issues/3390 2023-03-28 22:19:30 -07:00
Wez Furlong
07e1c5834b
mux: more robust handling of pane killing
Work harder to notice and handle the PaneRemoved notification
more centrally, which allows removing some earlier workarounds.

Now when we receive PaneRemoved, we take the opportunity to handle
missing mapping or stale mapping between local and remote ids and
perform a resync before continuing to handle the PaneRemoved message.

Doing it this way means that we don't need to second guess the timing
of notification or the resync, so we end up with the correct sequence
of notifications, and the result is the correct size of the splits
because the local and remote aren't independently managing the
the pane removal with conflicting ideas of the new size.

refs: https://github.com/wez/wezterm/issues/3386
2023-03-28 08:47:28 -07:00
Wez Furlong
a7fde7935b
raise ulimit nofile and nproc to a reasonable min value on unix systems
It's a tremendous PITA for the user to do this at the system level on a
mac, where it is sorely needed.  This commit allows raising to a desired
minimum level, but won't decrease from an already larger soft limit.

refs: https://github.com/wez/wezterm/discussions/3353
2023-03-28 07:29:47 -07:00
Wez Furlong
cb5252a246
mux client: GC unreferenced remote window/tab/pane ids on resync
refs: #2759
2023-03-27 21:38:29 -07:00
Wez Furlong
dd16e586c3
add pane:activate() and tab:activate()
refs: #3217
2023-03-27 21:12:10 -07:00
Wez Furlong
f8c60dcddc
docs: update for latest release 2023-03-26 19:45:32 -07:00
Wez Furlong
e56b169cc4
mux: add lua api equivalent to move-pane-to-new-tab
refs: #3374
2023-03-26 11:08:43 -07:00
Wez Furlong
d9d6b2a01a
mux: forward move-pane-to-new-tab requests to hosting mux
refs: #3374
2023-03-26 10:41:01 -07:00
Wez Furlong
98e137942a
mux: move-pane-to-new-tab didn't resync structure
Resolution is to propagate the MuxNotification to the clients
and have them resync.

refs: https://github.com/wez/wezterm/issues/3219
2023-03-25 20:50:03 -07:00
Wez Furlong
8dd365d4c5
mux: fix some dpi and pixel size issues
Three issues:

* The initial connect would leave the dpi assigned to 0, resulting
  in incorrect scaling when using imgcat until the window was resized
  and the correct dpi was passed up.
* On resize, we'd only compare the row/col count and not notice changes
  in pixel dimensions/dpi
* On the server side, when processing a resize and recomputing
  the tab size, we would omit the pixel dimensions and leave
  the resulting tabs and panes with 0 dimensions, breaking imgcat
  because it thought the window was 0x0.

refs: https://github.com/wez/wezterm/issues/3366
2023-03-25 20:24:57 -07:00
Wez Furlong
d491c736ef
When a modal is active, it gets first dibs on key processing
This fixes a surprising interaction between copy mode and the
command palette, but is also the root cause of another issue
with CharSelect mode.

refs: https://github.com/wez/wezterm/issues/2947
2023-03-25 18:32:38 -07:00
Wez Furlong
1c55ca14b0
macos: invalidate window when dispatching from menubar
refs: https://github.com/wez/wezterm/issues/3365
2023-03-25 13:47:54 -07:00
Wez Furlong
133faf8305
Add new-tab-button-click event
refs: #323
refs: https://github.com/wez/wezterm/discussions/3364
2023-03-25 13:26:16 -07:00
Wez Furlong
843b9e8fc4
update bundled JetBrainsMono to 2.304 2023-03-25 07:18:29 -07:00
Wez Furlong
499e5f73d0
palette: show the label from the command in the palette
Given an assignment like this:

```
{
  key = "b",
  mods = "ALT",
  action = wezterm.action.SplitPane {
    direction = 'Right',
    command = {
      label = 'Bash Right',
      args = {'/usr/bin/bash' }
    }
  }
}
```

we should show the label from the command in the palette.
That's what this commit enables.

If there is no label, but the arguments are set, then the
arguments will be shown instead.

refs: #3252
2023-03-24 21:05:14 -07:00
Wez Furlong
b113cc909e
docs: changelog for https://github.com/wez/wezterm/pull/3344 2023-03-24 19:23:47 -07:00
Wez Furlong
3ee0335a40
more entitlements on macos
refs: https://github.com/wez/wezterm/issues/3359
2023-03-24 18:33:02 -07:00
Wez Furlong
604ef152be
add wezterm cli activate-pane, wezterm cli activate-tab
refs: #3352
refs: https://github.com/wez/wezterm/issues/886
2023-03-24 17:32:55 -07:00
Wez Furlong
f44d02504c
Add: wezterm cli kill-pane
refs: #3352
2023-03-24 17:31:34 -07:00
Wez Furlong
f71bce1727
mux: propagate pane focus change events to clients
This commit causes the mux to generate a PaneFocused notification
when the active pane is changed.

The mux server will forward that as a unilateral PDU to connected
clients.

The clientpane implementation will handle that by applying the
same state to the local mux.

refs: #2863
2023-03-24 13:13:31 -07:00
Wez Furlong
bc7acc18e0
fixup images with the multiplexer
* Translate from File to EncodedFile as needed
* Adopt blob leases in the mux server
* Fix an issue where the first image sent by the mux server would
  be replaced on the client by its background image, if configured.
  Removed the ImageData::id field to resolve this: you should use
  the hash field instead to identify and disambiguate images.
  Bumped the termwiz API version because this is conceptually
  a breaking change to the API

refs: https://github.com/wez/wezterm/issues/3343
2023-03-23 21:43:28 -07:00
Wez Furlong
448a9fe78a
macos: don't treat command line args as .command scripts
Weird behavior from macos; the command line:

`wezterm start vim hello`

would result in macos requesting `vim` and `hello` be opened
as "documents" which would route each of those to the .command
script handling flow and spawn a window for each; running:

`vim ; exit` in one
`hello ; exit` in another

in addition to the normal handling of that command line.

This commit resolves this by igoring document opening
requests until after the application is fully launched.

I tested this by trying to open a .command script with
this new build and verified that that continued to work.

refs: #3340
2023-03-23 19:21:42 -07:00
Wez Furlong
6658ee7730
docs: changelog for #3339 2023-03-23 14:04:43 -07:00