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

834 Commits

Author SHA1 Message Date
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
Wez Furlong
7bb721ab7a
docs: note about sigmask change
f2a2d099bb
2023-03-23 12:02:30 -07:00
Wez Furlong
897237cc97
fix: disable mouse reporting for RIS/ResetTerminal sequence 2023-03-23 12:01:24 -07:00
Wez Furlong
57a1b7f2ef
factor window border sizes when computing window sizes
This one was a bit weird because something appeared to be a bit
non-deterministic.  With this config:

```lua
local wezterm = require 'wezterm'

return {
  window_frame = {
    border_left_width = '1cell',
    border_right_width = '1cell',
    border_bottom_height = '0.5cell',
    border_top_height = '0.5cell',

    border_left_color = '#444',
    border_right_color = '#444',
    border_bottom_color = '#444',
    border_top_color = '#444',
  },

  window_padding = {
    left = '1.5cell',
    right = '1.5cell',
    top = '0.5cell',
    bottom = '0.5cell',
  },
}
```

starting wezterm could result in a terminal that reported either 23 or
24 lines. I got 24 when running the build from da7e29df but usually
23 when running a build out of my repo.

Looking closely, the issue is that the initial window size didn't
account for the configured border size, and that we'd subsequently
fix that up when we later do a resize fixup after creating the window.

This commit refactors the window border logic so that it can be
used prior to having fully constructed the terminal window and then
uses that to fixup the initial computed dimensions.

I also noticed with this config that increasing the font size
with CTRL-+ could also result in an inconsistency between the displayed
terminal size and the pty size we set in the kernel: it was missing
the border adjustment as well, so I added it in there.

refs: #3333
2023-03-23 07:11:07 -07:00
Wez Furlong
16c913783d
docs: changelog for #3323 #2879 #3303 2023-03-22 21:38:53 -07:00
Wez Furlong
dc36fe18f4
term: adjust logical line wrapping behavior
Really, this is adjusting the logical line breaking behavior, or the
lack thereof.

The situation is this: conpty can decided to reinterpret and flush
large sections of its buffer as a continuous stream of unbroken
characters with no breaks when it repaints the full screen.

When we receive such an update, we see it as one long logical line,
and when we subsequently select multiple lines we can run into the
maximum logical line length and insert invalid synthetic line breaks
into the data that we send to the clipboard.

This commit adjusts the wrapping logic at the time that we receive
the text so that we don't tag the line as a logical line continuation
if:

* The alt screen is active. Full screen apps will re-render on resize
  anyway, and we don't reflow long lines on resize either for the same
  reasons

* If we are talking to ConPTY:
     * If the last character in the line is not alphanumeric or
       punctuation (in other words: it doesn't look plausibly like
       text that should be a line continuation).

refs: #3278
refs: #3177
2023-03-22 19:13:26 -07:00
Wez Furlong
69f9e1a429
docs: changelog for #3330 2023-03-22 18:07:29 -07:00
Wez Furlong
4913817067
allow json encoding wezterm.GLOBAL entries 2023-03-22 09:30:02 -07:00
Wez Furlong
b384dc999f
fix delegation of --skip-config to wezterm-gui
refs: #3325
2023-03-22 07:24:02 -07:00
Wez Furlong
c30ff69d26
docs: changelog for #3227 2023-03-21 22:11:22 -07:00
Wez Furlong
8755e731d3
add __len and __pairs metamethods to wezterm.GLOBALS
Fixes this:

```
> wezterm.GLOBAL.foo = {"bar", "baz"}
> wezterm.GLOBAL.foo
[
    "bar",
    "baz",
]
> #wezterm.GLOBAL.foo
runtime error: [string "repl"]:1: attempt to get length of a userdata value (field 'foo')
stack traceback:
        [string "repl"]:1: in main chunk
>
```

and allows this:

```
> for k, v in pairs(wezterm.GLOBAL.foo) do print(k, v) ; end
```
2023-03-21 21:04:52 -07:00
Wez Furlong
5a738446e2
docs: allow search to find 'changelog'
It's a little bit inelegant, but the mkdocs-material folks seem to have
a nicer solution in the works, so this will do for now.

closes: https://github.com/wez/wezterm/issues/3305
refs: https://github.com/squidfunk/mkdocs-material/issues/3174
2023-03-21 12:29:32 -07:00
Wez Furlong
c781be3124
wezterm-ssh: fix parsing of proxycommand
refs: https://github.com/wez/wezterm/issues/3307
2023-03-21 08:04:59 -07:00
Wez Furlong
8c4d71d516
Docs: update changelog for 20230320-124340-559cb7b0 release 2023-03-20 17:36:39 -07:00
Wez Furlong
dd8d4a04f4
sync from https://github.com/folke/tokyonight.nvim
Pull in the enhanced scheme that includes wezterm metadata and colors.

Co-authored-by: Thomas Croft <103956335+thomascft@users.noreply.github.com>

closes: https://github.com/wez/wezterm/pull/3208
2023-03-20 12:42:09 -07:00
Wez Furlong
775bad32e1
sync color schemes 2023-03-20 12:25:44 -07:00
Wez Furlong
96d155170e
docs: fix typo in changelog 2023-03-19 22:17:22 -07:00