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

1171 Commits

Author SHA1 Message Date
Wez Furlong
e5e5ce610e
palette: add full doc and enum name to text to match
refs: https://github.com/wez/wezterm/issues/1485
2023-02-07 15:41:37 -07:00
Wez Furlong
d2905d53b1
defer loading background until after rescaling in config reload
render metrics might be adjusted by the scaling logic, so we
should load the background after resizing.
2023-02-07 09:32:08 -07:00
Wez Furlong
f031acfe43
wgpu: ensure that the srgb format is available before using it
refs: https://github.com/wez/wezterm/issues/3032
2023-02-06 07:40:30 -07:00
Wez Furlong
9945c04e8f
fixup test for nerd font symbol update 2023-02-06 07:23:59 -07:00
Wez Furlong
74dc74b7c8
deps: wgpu -> 0.15
This might help with https://github.com/wez/wezterm/issues/3032
2023-02-06 07:19:31 -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
d2fd2c6b1a
remove some debug prints
These are no longer needed
2023-02-05 18:00:22 -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
Italo Cunha
09e82b353a
Add bindings for Home and End in copy_mode (#2762)
* Add bindings for Home and End in copy_mode

* Add Home/End bindings to copymode.md

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-02-05 09:20:01 -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
9e3a5ba8fa
cargo fmt 2023-02-05 07:58:31 -07:00
Wez Furlong
d336c8a61e
deps: http_req -> 0.9 2023-02-05 07:38:55 -07:00
gzliew
20c8135fc5 fix(wezterm-gui): Move word able to jump next line 2023-02-05 06:33:57 -08:00
Wez Furlong
691ec187ba
macos: don't include LEADER based key assignments in menubar
refs: https://github.com/wez/wezterm/issues/3021
2023-01-27 15:52:54 -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
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
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
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
9a76a54081
add window activation items to palette and menubar
refs: https://github.com/wez/wezterm/issues/2973
2023-01-19 20:54:18 -07:00
gzliew
6164b871d5 chore(wezterm-gui): Create move_to_end_of_word 2023-01-19 19:08:07 -08:00
gzliew
15bb1a87a1 feat(wezterm-gui): Support move to word end 2023-01-19 19:08:07 -08: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
Niclas Hoyer
962c10330f Use dpi from configuration while resizing 2023-01-18 19:07:43 -08:00
Wez Furlong
7bb6973473
palette: ensure reverse background block spans full width
This makes the command palette look a bit more consistent.

refs: https://github.com/wez/wezterm/issues/1485
2023-01-13 20:31:53 -07:00
Wez Furlong
67ce66a5b9
macos: enable opacity for webgpu
Seems to do the job for me!

refs: https://github.com/wez/wezterm/issues/2952
2023-01-12 22:39:01 -07:00
Wez Furlong
5da0ef4c12
macos: fixup application termination
The recently added app delegate was telling cocoa that we'd decide
to quit later in response to termination requests, blocking
shutdown/logout/restart.

This commit introduces a macos native modal alert to let the user
decide whether to quit or not.

While testing this, I noticed that in some cases, our internal choice
to quit had no effect.  Reading the fine print of NSApp::stop, it sounds
like calling it from a modal context will only stop a modal rather then
exit out of NSApp::run, so we explicitly bounce through an event
callback to try to make it exit from the right place.

I'm not 100% convinced by this.  I've left some debug prints in for
now to see if those give some insight in the future.

refs: https://github.com/wez/wezterm/issues/2944
2023-01-12 16:49:19 -07:00
ProspectPyxis
087a3cef9a feat: hide_mouse_cursor_when_typing config option 2023-01-12 08:08:42 -08:00
Wez Furlong
c19b65054f
gui: include x11 window manager in connection name 2023-01-09 16:22:48 -07:00
Wez Furlong
81f1979cd4
gui: describe connection and show it in debug overlay
Also helpful to understand the user's environment in problem reports
2023-01-09 15:59:54 -07:00
Wez Furlong
f268964a65
gui: add target triple to debug overlay
This helps to understand the OS in user reports
2023-01-09 15:52:16 -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
c9a0537b7b
palette: fix min width
This avoids a jarring situation where the width rubber-bands to fit
a run of narrower text when scrolling down through the list of options.

refs: https://github.com/wez/wezterm/issues/1485
2023-01-08 07:58:23 -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
040fa07938
Tweak labels in the menubar/command palette
refs: https://github.com/wez/wezterm/issues/1485
2022-12-26 16:56:23 -07:00
Wez Furlong
378853f5a5
palette: add icons for a number of entries
refs: https://github.com/wez/wezterm/issues/1485
2022-12-24 16:26:06 -07:00
Wez Furlong
b2e694032f
box model: improve max width constraint for more complex elements
Do a better job at constraining elements with multiple children
to the appropriate width
2022-12-24 16:25:48 -07:00
Wez Furlong
b52ccfe36a
palette: adjust group prefix when menubar is empty
Avoid printing `: ` at the start of the line

refs: https://github.com/wez/wezterm/issues/1485
2022-12-24 08:17:24 -07:00
Wez Furlong
b1c3103a08
macos: update menubar when the config reloads
This is moderately painful to do, because of some objc/cocoa lifetime
concern that causes a crash when attempting to simply replace the
entire menubar, so we try to find/update items instead.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-24 00:10:04 -07:00
Wez Furlong
1fad25e926
include key assignments in palette and menubar
Fixup CopyMode key assignments; they were all incorrectly
labelled as activating copy mode, which isn't correct.
We're just using Debug labelling for them at the moment,
need to get that fixed properly.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-23 20:18:26 -07:00
Wez Furlong
85afd9b599
tidy up macos menubar key assignment
This commit safely registers key equivalents with the menubar.  Safe in
this context means "doesn't override a key assignment from a key table".
For example, it would suck to define an application-wide key assignment
for a key combination that has a different assignment in a key table
that may be activated conditionally by some user-defined state/mode.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-23 19:59:35 -07:00
Wez Furlong
1cdf74d19e
menubar: re-categorize attach/detach
refs: https://github.com/wez/wezterm/issues/1485
2022-12-23 14:55:50 -07:00
Wez Furlong
b12506ea30
command palette: tweak for empty doc case
refs: https://github.com/wez/wezterm/issues/1485
2022-12-23 14:55:16 -07:00
Wez Furlong
3a9513e194
improve width constraints in box_model, center command palette
refs: https://github.com/wez/wezterm/issues/1485
2022-12-23 09:03:51 -07:00
Wez Furlong
b789ec447a
synthesize commands from domains, workspaces
Similar to the equivalent functionality in the launcher menu,
syntheisze some default commands based on the current state
of the launcher menu (config) and mux (domains, workspaces).

This does mean that the launcher menu may show duplicates for these
if it has COMMANDS enabled.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-22 20:56:50 -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
82da1b42f7
launcher: prefer to use human description of key assignment
refs: https://github.com/wez/wezterm/issues/1485
2022-12-21 13:31:05 -07:00
Wez Furlong
98479d8530
Re-organize default command list
refs: https://github.com/wez/wezterm/issues/1485
2022-12-21 13:26:18 -07:00