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

6602 Commits

Author SHA1 Message Date
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
295e0c444f
ci: potentially fixup flakey pages build
It has been failing sporadically due to GH API rate limiting.
Use the gh CLI if available, to pick up our access token.
2022-12-22 10:54:17 -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
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
Wez Furlong
01962235f4
add descriptions for all keyassignment actions
refs: https://github.com/wez/wezterm/issues/1485
2022-12-21 13:08:24 -07:00
Wez Furlong
669fec9a9f
adjust default command list
re-structure it so that we have a list of default action values,
and a function that can compute the command description from them.

This allows describing user-specified actions in the future,
as well as reducing some boilerplate: we can now generate eg:
ActivateTab(n) description text without hardcoding similar
alternatives.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-21 11:00:45 -07:00
Wez Furlong
37b5dd91a5
move OpenInBrowser -> KeyAssignment
This allows defining those help actions that open URLs in the main
commands list, and not just for the macOS Help menu.

refs: https://github.com/wez/wezterm/issues/1485
2022-12-21 07:04:51 -07:00
Wez Furlong
4b3660d166
macos: allow running when there are no windows
Most of this commit is refactoring the spawn logic so that we
can reuse most of it to handle spawn requests when there is
no GUI window.
2022-12-21 00:31:58 -07:00
Wez Furlong
f7eb13dd8d
put quit at bottom of application menu 2022-12-21 00:31:58 -07:00
Wez Furlong
787f6550b8
macos: link to helpful resources from Help menu 2022-12-21 00:31:58 -07:00
Wez Furlong
b5aea795ca
fixup tests
refs: https://github.com/wez/wezterm/issues/162
refs: https://github.com/wez/wezterm/issues/1485
2022-12-20 20:48:44 -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
eb8dfd32b3
macos: use interactive shell for .command scripts
This is primarily so that the user's environment is set up prior
to invoking the script.

refs: #2871
2022-12-20 08:30:07 -07:00
Wez Furlong
0da36a40fd
ci: refine error reporting in doc build 2022-12-19 22:11:01 -07:00
Wez Furlong
19b01261cb
mux: avoid deadlock in mux server
Ensure that we don't need a lock to examine the tab_id
2022-12-19 22:06:59 -07:00
Wez Furlong
fe55ace7d9
deps: harfbuzz -> 6.0.0 2022-12-19 17:33:00 -07:00
Wez Furlong
e020a9f6cd
fix windows build 2022-12-19 15:21:13 -07:00
Wez Furlong
30238acb1b
x11: potential fix for hanging IME
refs: https://github.com/H-M-H/xcb-imdkit-rs/issues/5
refs: https://github.com/wez/wezterm/issues/2819
2022-12-19 12:23:04 -07:00
Wez Furlong
02eb0b4294
mux: rename Mux::get() -> try_get(), add "infallible" Mux::get()
This allows removing a bunch of unwrap/expect calls.

However, my primary motive was to replace the cases where we used
Mux::get() == None to indicate that we were not on the main thread.

A separate API has been added to test for that explicitly rather than
implicitly.
2022-12-19 11:55:35 -07:00
Wez Furlong
478cc59be3
mux: Mux is now Send+Sync 2022-12-19 11:54:02 -07:00
Wez Furlong
ee2aac0902
mux: require that Domain be Send + Sync 2022-12-19 11:52:38 -07:00
Wez Furlong
920ee853b3
mux: switch RefCell to RwLock internally
This is a step towards making it Send+Sync.

I'm a little cagey about this in the long term, as there are some mux
operations that may technically require multiple fields to be locked for
their duration: allowing free-threaded access may introduce some subtle
(or not so subtle!) interleaving conditions where the overall mux state
is not yet consistent.

I'm thinking of prune_dead_windows kicking in while the mux is in the
middle of being manipulated.

I did try an initial pass of just moving everything under one lock, but
there is already quite a lot of mixed read/write access to different
aspects of the mux.

We'll see what bubbles up later!
2022-12-19 11:52:38 -07:00
Wez Furlong
696148941c
Rc<Tab> -> Arc<Tab> 2022-12-19 11:52:38 -07:00
Wez Furlong
b58d026542
mux: make Tab Send+Sync 2022-12-19 11:52:38 -07:00
Wez Furlong
9e67ad7861
mux: reduce context switching when parsing output
Now that we use Arc<Pane> we can directly pass the pane to the
background thread that we're using to parse the terminal output, cutting
out some context switching and reducing the latency between output and
rendering that output.
2022-12-19 11:52:37 -07:00
Wez Furlong
aa3d722e1f
mux: add notify_from_any_thread helper 2022-12-19 11:52:37 -07:00
Wez Furlong
6e06b9af02
mux: Pane is now required to be Send+Sync. Use Arc<dyn Pane> 2022-12-19 11:52:33 -07:00
Wez Furlong
758a09f55f
ci: add debug output when building docs
This step is flaking out often in CI and I'd like to get a better sense
of why.
2022-12-19 11:45:29 -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
0fa8e9bc86
cargo update 2022-12-19 11:13:02 -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
Wez Furlong
f22eec7970
docs: add aarch64 macos example to target_triple 2022-12-17 21:59:49 -07:00
Wez Furlong
91ea1095c9
deps: update base64
closes: https://github.com/wez/wezterm/pull/2855
2022-12-12 09:15:09 -07:00
Wez Furlong
8a527fe7bc
cargo update 2022-12-12 09:02:19 -07:00
Val Packett
9fb7f8fe49 add .mailmap 2022-12-07 12:09:06 -08:00
Val Packett
896256e420 docs: changelog: chase username change 2022-12-07 12:09:06 -08:00
Wez Furlong
92e851d648
docs: expand font_rules
refs: #2836
2022-12-06 09:36:35 -07:00
Wez Furlong
af9d0efa17
cargo update 2022-12-04 19:40:53 -07:00
cgrigis
fcace3d5e3
Remove Source entry in Debian control file (#2828)
Remove `Source` entry in final Debian control file
2022-12-04 08:53:37 -07:00
Russell Cloran
8d8d7d3ff4 Fix shell-resolution documentation in launch 2022-11-30 11:13:38 -08:00
dependabot[bot]
c6e29b78b7 build(deps): bump rstest from 0.15.0 to 0.16.0
Bumps [rstest](https://github.com/la10736/rstest) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/0.15.0...0.16.0)

---
updated-dependencies:
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-27 21:52:32 -08:00