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

773 Commits

Author SHA1 Message Date
Wez Furlong
2d05f8f1f2
ssh: support %l and %L in config files
We also log a warning when an unsupported token is used.

refs: https://github.com/wez/wezterm/issues/3176
2023-03-01 18:44:11 -07:00
Wez Furlong
0006014f02
ssh: detect exit-signal state for channels
Need to use a newer version of libssh-rs that can report this state,
as the underlying libssh doesn't fold it into the process exit
status.

refs: https://github.com/wez/wezterm/issues/3095
2023-02-11 10:03:44 -07:00
Wez Furlong
797d3819b7
wsl: default_cwd is now ~
This matches up better to most peoples expectations

refs: https://github.com/wez/wezterm/issues/2826
2023-02-11 08:21:18 -07:00
Wez Furlong
51e0c1b393
x11/wayland: restore mouse copying to both clipboard and primary selection
I don't recall changing it to copy to the primary selection only, and
it doesn't feel like it is something I would want anyway, and I think
it generally makes things annoying for all but power users

https://fosstodon.org/@trentskunk@mstdn.social/109808345817367266
2023-02-09 12:56:51 -07:00
Wez Furlong
1596934132
docs: command palette
refs: https://github.com/wez/wezterm/issues/1485
2023-02-07 16:32:42 -07:00
Wez Furlong
d00845baad
docs: webgpu
refs: https://github.com/wez/wezterm/issues/2756
2023-02-07 11:16:55 -07:00
Wez Furlong
cc15f97a55
mux: only resize zoomed pane when resizing a tab
Previously, when resizing a tab, we'd unzoom it, recompute the resize
deltas and adjust every pane's non-zoomed position and re-zoom the
original pane.

When the alt screen is active, wezterm doesn't reflow resized lines,
and there a number of situations where the only effective change to
the line was updating a seqno; the content of those panes doesn't
actually update until the application(s) attached to the PTY
receive SIGWINCH from the kernel.

Since we were resizing the zoomed pane twice in quick succession
we could double-tap SIGWINCH and the application might coalesce
and process only one of the resize events.

The result of that was that we might see the state from either
the first or second resize event and then not get any other updates
until the application repainted itself.

This commit re-structures the resize behavior around zooms so that
we only resize the zoomed pane.  When unzooming we'll fixup the
no-zoomed sizes for the whole tab. That means that we need to
store the pre-zoom size in order to correctly calculate those
sizes for the case where a pane was zoomed, the tab resized, and
then the pane was unzoomed again.

refs: https://github.com/wez/wezterm/issues/3068
2023-02-07 09:32:08 -07:00
Wez Furlong
44e162a986
fonts: update Symbols Nerd Font Mono
This is "NerdFontsSymbolsOnly/Symbols-1000-em Nerd Font Complete Mono.ttf" from
https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.3.3
2023-02-06 06:29:32 -07:00
Wez Furlong
2b298f5f96
mux: pass gui window position through from new mux window
Threads through a GuiPosition from mux window creation to allow it to be
used when the corresponding gui window is created.

SpawnCommand now has an optional position field to use for that purpose.

```lua
wezterm.mux.spawn_window {
  position = {
    x = 10,
    y = 300,
    -- Optional origin to use for x and y.
    -- Possible values:
    -- * "ScreenCoordinateSystem" (this is the default)
    -- * "MainScreen" (the primary or main screen)
    -- * "ActiveScreen" (whichever screen hosts the active/focused window)
    -- * {Named="HDMI-1"} - uses a screen by name. See wezterm.gui.screens()
    -- origin = "ScreenCoordinateSystem"
  },
}
```

refs: https://github.com/wez/wezterm/issues/2976
2023-02-05 21:43:37 -07:00
Wez Furlong
6968ad5c3c
Add quit_when_all_windows_are_closed config option
refs: https://github.com/wez/wezterm/issues/3057
2023-02-05 16:55:56 -07:00
Wez Furlong
98c90215da
docs: changelog for https://github.com/wez/wezterm/pull/2887 2023-02-05 10:56:44 -07:00
Wez Furlong
71ec5ac0a8
docs: changelog for https://github.com/wez/wezterm/pull/3054 2023-02-05 09:28:27 -07:00
Wez Furlong
6590fa5b7e
docs: changelog for https://github.com/wez/wezterm/pull/2762 2023-02-05 09:24:32 -07:00
Wez Furlong
1609fd386b
add wezterm cli get-text command
closes: https://github.com/wez/wezterm/pull/2729
2023-02-05 09:05:48 -07:00
Wez Furlong
7274636559
docs: changelog for #2955 2023-02-05 07:35:31 -07:00
Wez Furlong
b9739a24d1
docs: changelog for https://github.com/wez/wezterm/pull/3053 2023-02-04 07:38:21 -07:00
Wez Furlong
ed444faf91
docs: changelog for #2959 2023-02-02 08:27:31 -07:00
Wez Furlong
9ae6a561a0
fix command output not being displayed for short lived commands
repro with:

```
wezterm --config 'exit_behavior="Hold"' start ls
```
2023-01-26 16:10:19 -07:00
Wez Furlong
d7145561c2
Add wezterm start --domain DOMAIN --attach + gui-attached event
The motivation here was to remove some similar but not quite the same
logic that existed for starting up when using `wezterm connect`.

Now `wezterm connect DOMAIN` is implemented as `wezterm start --domain
DOMAIN --attach --always-new-process` and a little extra hand-wave to
ensure that the default domain is set correctly.

The startup events have been refactored a bit; a new gui-attached
event is emitted after attaching and starting any default programs
in the selected domain at startup.

That event can be used to maximize windows and so on, if desired.

The gui-attached event is independent of the startup command and fires
for `wezterm connect`, which `gui-startup` did not (and could not) do.
2023-01-26 15:56:11 -07:00
Wez Furlong
9d7e613cfa
wezterm.GLOBAL now returns references to stored data
This smoothes out a rough edge and makes things work
more naturally.

refs: https://github.com/wez/wezterm/discussions/2983
2023-01-24 18:26:14 -07:00
Wez Furlong
6f62a0f2b1
config: capture warnings and show them in config error window
This allows deprecated and invalid fields to be surfaced more visibly
in the config error window.
2023-01-24 14:18:15 -07:00
Wez Furlong
252817b0b8
config: add wezterm.config_builder
config_builder helps to make issues more visible/useful in the case
where you may have typod a config option, or otherwise assigned
an incorrect value.
2023-01-24 11:57:07 -07:00
Wez Furlong
9350795f33
x11: always update selection ownership
refs: https://github.com/wez/wezterm/issues/2926
2023-01-21 18:24:29 -07:00
Wez Furlong
33f25e9ce6
reduce latency when heavily using foreground process info
The tcgetpgrp call appears to have high variance in latency, ranging
from 200-700us on my system.

If you have 10 tabs and mouse over the tab bar, that's around 7ms
spent per frame just figuring out the foreground process; that doesn't
include actually extracting the process executable or current working
directory paths.

This was exacerbated by the mouse move events triggering a tab bar
recompute on every pixel of mouse movement.

This commit takes the following steps to resolve this:

* We now only re-compute the tab bar when the UI item is changed by
  a mouse movement
* A simple single-item cache is now used on unix that allows the caller
  to proceed quickly with stale-but-probably-still-mostly-accurate data
  while queuing up an update to a background thread which can absorb
  the latency.

The result of this is that hovering over several tabs in quick
succession no longer takes a noticeable length of time to render the
hover, but the consequence is that the contents of a given tab may be
stale by 300-400ms.

I think that trade-off is worth while.

We already have a similar trade-off on Windows, although we don't
yet do the updates in a different thread on Windows. Perhaps in
a follow up commit?

refs: https://github.com/wez/wezterm/issues/2991
2023-01-21 15:25:57 -07:00
Wez Furlong
9dc76b852b
lua: add some more tab methods 2023-01-20 20:02:29 -07:00
Wez Furlong
0dc7d92b6c
modals: invalidate window after assignment
On my mac, depending the config, I noticed that modals didn't always
render immediately; force a window invalidation after assigning to
encourage them to do so.
2023-01-20 12:09:07 -07:00
Wez Furlong
59b609f592
window:active_key_table now includes per-pane stacks
refs: https://github.com/wez/wezterm/discussions/2986
2023-01-20 07:03:19 -07:00
Wez Furlong
523dafe757
docs: change log and docs for https://github.com/wez/wezterm/pull/2908 2023-01-19 20:14:34 -07:00
Wez Furlong
c042005ee0
mux: try harder to use default_workspace from config
There were a couple of cases where we didn't look at the config
when deciding on the workspace name.

refs: https://github.com/wez/wezterm/issues/2981
2023-01-19 07:47:27 -07:00
Wez Furlong
b01aa129f7
add WindowOps::focus, ActivateWindow, window:focus()
Only implemented on X11 so far.
Note that Wayland doesn't support this action at all.

refs: https://github.com/wez/wezterm/issues/2973
2023-01-18 22:58:48 -07:00
Wez Furlong
4f1e2604eb
docs: changelog for https://github.com/wez/wezterm/pull/2977 2023-01-18 20:14:50 -07:00
Wez Furlong
9ea19b094b
docs: changelog for https://github.com/wez/wezterm/pull/2978 2023-01-18 20:11:43 -07:00
Wez Furlong
15cd1afbdc
lua: add some pane methods for working with zones
refs: https://github.com/wez/wezterm/issues/2968
2023-01-18 19:38:51 -07:00
Wez Furlong
30f8c0151f
docs: changelog for https://github.com/wez/wezterm/pull/2946 2023-01-12 09:10:26 -07:00
Wez Furlong
b86f5365a1
sync color schemes 2023-01-11 16:30:58 -07:00
Wez Furlong
349c2ed5d5
docs: changelog for https://github.com/wez/wezterm/pull/2928 2023-01-11 09:10:22 -07:00
Wez Furlong
4ec428ff75
config: allow using bright but not bold text when brightening text
In https://github.com/wez/wezterm/issues/2932 the user desired to have
brightened text without the boldness, as they were accustomed to that
behavior in a couple of other terminal emulators.

This commit changes the `bold_brightens_ansi_colors` from a simple
boolean to a tristate that allows for not changing the brightness,
changing the brightness, and changing the brightness while adjusting
the boldness down to normal levels.

boolean values are accepted for backwards compatibility.
2023-01-09 15:19:17 -07:00
Wez Furlong
37055d2fab
expose some mux domain stuff to lua
refs: https://github.com/wez/wezterm/issues/2933
2023-01-09 08:38:05 -07:00
Wez Furlong
fc481106af
windows: avoid panic when minimizing w/ WebGpu
```
thread 'main' panicked at 'Error in Surface::configure: Both `Surface` width and height must be non-zero. Wait to recreate the `Surface` until the window has non-zero area.', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.14.0\src\backend\direct.rs:274:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

refs: https://github.com/wez/wezterm/issues/2881
2022-12-30 08:52:01 -07:00
Wez Furlong
a31ba8738c
ssh: respect AddressFamily for environments with broken ipv6
We have to manually connect for this to work well across both
underlying libraries. libssh in particular doesn't support it
at all.

refs: https://github.com/wez/wezterm/issues/2893
2022-12-26 16:18:18 -07:00
Wez Furlong
c39bbbb451
docs: changelog for https://github.com/wez/wezterm/issues/2782
refs: https://github.com/wez/wezterm/pull/2889
2022-12-25 06:03:40 -07:00
Wez Furlong
ab8a4f129c
command palette: first pass
This commit introduces a rough first pass at a command palette modal.
It is an adaptation of the emoji character selector and needs
refinement.

Importantly, the default pane selector key assignment now calls
into this new command palette instead.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-22 20:24:57 -07:00
Wez Furlong
6479df63b9
removed deprecated Copy, Paste, PastePrimarySelection actions
These have been deprecated since early 2021; time to remove them
and simplify a little.
2022-12-22 07:31:18 -07:00
Wez Furlong
72da5d161e
docs: changelog for https://github.com/wez/wezterm/issues/2819 2022-12-21 16:34:01 -07:00
Wez Furlong
b224aa1b56
macOS: add MenuBar
This took a decent amount of effort to thread through with context;
wrappers around NSMenu and NSMenuItem are added to reduce some of
the objc usability warts, and an additional NSObject wrapper is
added to help copy the KeyAssignment from the existing list
of command palette commands and associate it with the menu item.

When a menu item is selected, macOS will walk through the responder
chain and look for a responder that responds to the selector associated
with the menu item.  In practice that means that our window/view class
will be tried first, and then later, our app delegate will be tried.

This commit implements routing from both of these: the window case
routes to the associated TermWindow and drops into the existing
perform_key_assignment method.

In case there is no window (not currently possible, but will be
in the future), the app delegate also has a placeholder for dispatching
key assignments, although it will only be able to perform a subset
of the possible actions.

A couple of things to note:

* Items aren't smart enough to disable themselves or adjust their
  caption based on the context. To make that work, we either need
  to recreate the entire menubar when any possible context changes
  (doable, but feels heavy), or we need to assign a target to each
  menu item and implement a validation handler on that target.
  That seemed to mess with the responder chain when I briefly
  experimented with it.

* There's some disabled code to add a Services menu. It is disabled
  because when it is enabled, accessing either Services or Help
  from the menu bar sends the process into a busy loop somewhere
  in macOS's internals.  It's unclear what it is unhappy with.

* No keyboard accelerators are associated with the menubar yet.
  That needs some thought, as they would essentially become global
  keyboard shortcuts and take precedence over the shortcuts defined
  for other keys in the config.  This feels like it should be something
  that the user has control over, so there needs to be something to
  allow that before we go ahead and wire those up.

refs: https://github.com/wez/wezterm/issues/162
refs: https://github.com/wez/wezterm/issues/1485
2022-12-20 19:46:08 -07:00
Wez Furlong
fe55ace7d9
deps: harfbuzz -> 6.0.0 2022-12-19 17:33:00 -07:00
Wez Furlong
fe60155d3d
withdraw DEC private SGR handling for super/subscript
refs: https://github.com/mintty/mintty/issues/1189
refs: https://github.com/mintty/mintty/issues/1171
2022-12-19 11:37:53 -07:00
Wez Furlong
28c7c0ba19
macos: allow association with .command file type
Implement an app delegate to receive a callback when the system
requests that we open `.command` files, and then ask the mux
layer to spawn a window for it and execute it via the shell.

Also allow handling `.sh`, `.zsh`, `.bash`, `.fish` and `.tool`,
per kitty.

refs: https://github.com/wez/wezterm/issues/2741
refs: https://github.com/wez/wezterm/issues/2871
2022-12-19 11:06:12 -07:00
Wez Furlong
e70f97903b
disable window title reporting escape sequence by default 2022-12-18 10:37:21 -07:00
Val Packett
896256e420 docs: changelog: chase username change 2022-12-07 12:09:06 -08:00