1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-26 06:42:12 +03:00
Commit Graph

1285 Commits

Author SHA1 Message Date
Wez Furlong
53ad753b28 wezterm: helper env for testing the update ui 2020-06-06 16:22:28 -07:00
Wez Furlong
5caafc45e0 wezterm: hide connui immediately on connection success 2020-06-06 14:32:34 -07:00
Wez Furlong
c6b27131e4 wezterm: avoid busy loop if connui is closed early
I noticed a busy period when closing the connui when it is performing
the sleep with progress bar stage; returning from the function when
the channel disconnects seems like the right call.

I also made the loop slightly more efficient by only repainting if
the line has changed.
2020-06-06 14:18:39 -07:00
Wez Furlong
afe72f3bc5 wezterm: fix occasional hang when initiating a mux connection
I don't really like this as a solution, however: I'd rather
spend time transitioning towards async IO for this instead of
troubleshooting further here.
2020-06-06 11:44:22 -07:00
Wez Furlong
adb0ae6576 wezterm: remove workaround for ssh crate
All of the types in that crate are now Send so we don't have
to force that here.
2020-06-06 10:05:25 -07:00
Wez Furlong
bd57029427 wezterm: allow specifying the remote wezterm path for mux clients
both tls and ssh domains now have a `remote_wezterm_path` config
option.
2020-06-06 10:01:39 -07:00
Wez Furlong
2e7f082bd7 wezterm: improve error reporting around mux connection failures 2020-06-06 09:46:25 -07:00
Wez Furlong
d660f53f86 wezterm: render release notes as markdown in the update UI
This adds a markdown -> termwiz render helper for the update UI
to make the release notes look a bit more intelligible.
2020-06-06 06:33:54 -07:00
Wez Furlong
cb6944f5eb wezterm: add buffer to termwiztermtab
I noticed that the launch menu was a bit flickery when moving
the mouse around, and I think a buffer will help.
2020-06-05 18:03:19 -07:00
Wez Furlong
62cd4665d2 wezterm: search mode: add PageUp + PageDown
These move one page at a time, which is useful when there are a lot
of matches in a given page.

refs: https://github.com/wez/wezterm/issues/91
2020-06-05 08:50:38 -07:00
Wez Furlong
c5f270f48b wezterm: windows: automatically add WSL entries to the launcher menu
This feels like a better out of the box experience.
The list can be disabled through the config if desired.
2020-06-05 07:25:35 -07:00
Wez Furlong
03ba1a98f0 wezterm: scroll the viewport when dragging to select text
closes https://github.com/wez/wezterm/issues/8
2020-06-04 20:39:51 -07:00
Wez Furlong
927129a97f wezterm: add word movement in the copy mode overlay 2020-06-04 08:40:23 -07:00
Wez Furlong
82261ff16d wezterm: enable scrollback in the error window
This commit doesn't do anything specific to scrollback though!
It moves the implementation of the TermWizTermTab away from
a directly manipulated Surface and over to using the term::Terminal,
making the renderer look more like the one used by the local tab
and domain implementation.

As a side effect of doing this, we get scrollback management
for free.

refs: https://github.com/wez/wezterm/issues/201
2020-06-03 08:45:03 -07:00
Wez Furlong
3946fc6738 wezterm: config: only trigger error display for reloads
Otherwise, during early startup we'll trigger one before the frontend
is started and show a toast message, and then later on we'll also
show the wezterm error window, which feels a bit redundant.

This way we reserve the toasts for panics and will generally
use the wezterm window.
2020-06-01 08:11:56 -07:00
Wez Furlong
a91d30f2e7 wezterm: fixup tests for lua/serde change
refs: https://github.com/wez/wezterm/issues/201
2020-05-31 20:06:37 -07:00
Wez Furlong
d0095f6bba wezterm: improve config deserialization error messages
This is a bit fiddly because the serde library doesn't let us know
eg: which key in a map had an error, so we have to show the information
from the value and hope that there is enough context for the user.

This commit adds our own Debug impl for ValueWrapper as that one
provided by mlua isn't useful for tables; our impl will iterate
the pairs in the table and pretty print them.

The struct error message has been adjusted to include the lua
value that failed to deserialize in addition to the type name.
Because the config structs can get quite large, this commit adjusts
the ordering of the components in the error message; we now print
the outermost error first and leave the most specific portion at
the bottom.  This is so that the error window is more likely to
show the most useful information at the bottom.

I've added some similar improvements when processing enums.
It's not perfect but hopefully more useful when figuring out
a config problem.

This invalid config:

```lua
local wezterm = require 'wezterm';
return {
  keys = {
    {key="{", mods="SHIFT|ALT", action="Search"},
  }
}
```

yields:

```
While (re)loading configuration: Error converting lua value returned by script /tmp/issue-201.lua to Config struct: while processing a struct of type `Config` with value:
{
    "keys": [
        {
            "mods": "SHIFT|ALT",
            "key": "{",
            "action": "Search",
        },
    ],
}
while processing a struct of type `Key` with value:
{
    "mods": "SHIFT|ALT",
    "key": "{",
    "action": "Search",
}
while processing an enum of type `KeyAssignment` and value "Search"
which has allowed variants `ActivateCopyMode`, `ActivateTab`, `ActivateTabRelative`, `ClearScrollback`, `CloseCurrentTab`, `CompleteSelection`, `CompleteSelectionOrOpenLinkAtMouseCursor`, `Copy`, `DecreaseFontSize`, `DisableDefaultAssignment`, `ExtendSelectionToMouseCursor`, `Hide`, `HideApplication`, `IncreaseFontSize`, `MoveTab`, `MoveTabRelative`, `Nop`, `OpenLinkAtMouseCursor`, `Paste`, `PastePrimarySelection`, `QuitApplication`, `ReloadConfiguration`, `ResetFontSize`, `ScrollByPage`, `Search`, `SelectTextAtMouseCursor`, `SendString`, `Show`, `ShowLauncher`, `ShowTabNavigator`, `SpawnCommandInNewTab`, `SpawnCommandInNewWindow`, `SpawnTab`, `SpawnWindow`, `ToggleFullScreen`
Expected a variant with parameters but got a unit variant instead
```

refs: https://github.com/wez/wezterm/issues/201
2020-05-31 17:56:39 -07:00
Wez Furlong
7f450482a7 wezterm: clamp viewport to scrollbar range
fixes https://github.com/wez/wezterm/issues/202
2020-05-31 15:16:21 -07:00
Wez Furlong
29239c632b wezterm: add mouseless-copy overlay
This allows navigating the scrollback and selecting text using
only the keyboard.
2020-05-31 10:41:25 -07:00
Wez Furlong
1ec37da248 wezterm: move search overlay to overlay dir 2020-05-30 23:15:43 -07:00
Wez Furlong
7c2dce479d wezterm: config: don't require that config files have .lua extension
This makes things a bit more convenient when testing and removes
an `unreachable!` that was actually reachable if you set
WEZTERM_CONFIG_FILE.
2020-05-30 20:10:10 -07:00
Wez Furlong
289f243095 wezterm: fix cursor blink timing
The captured variable used to track the last cursor time wasn't
working as intended; rather than reflecting the time of the last
blink update it was always reading as the time at which the window
was created which meant that we would choose to invalidate the
window on every candidate frame (every 35ms) rather than every
cursor blink interval, burning some CPU (~4-5% continuous on my system).

This was hard to spot because it looked like it was doing the right
thing.  It didn't show up as a hotspot in the profiler either :-p

This commit moves that state into the TermWindow itself; I see CPU
utilization drop to ~0.7% which is much better.

refs: https://github.com/wez/wezterm/issues/200
2020-05-30 19:36:15 -07:00
Wez Furlong
5835526055 wezterm: perf: shave off ~1.5ms from the p95 opengl render time
It doesn't sound like a lot but it's about 2x improved.  The
gain was made by avoiding allocating for the major cache lookups.
2020-05-30 18:34:06 -07:00
Wez Furlong
3e011f2696 wezterm: perf: lift some repeated computation up to caller
This is micro optimization that shaves some cycles off some
repeated computation during painting.
2020-05-30 15:12:05 -07:00
Wez Furlong
c44fa7659f wezterm: avoid repaint for blinking cursor when not focused
This takes CPU usage down to 0 when the window isn't focused.

refs: https://github.com/wez/wezterm/issues/200
2020-05-30 12:29:04 -07:00
Wez Furlong
8ff9340d2f wezterm: implement scrollback search for remote mux'd tabs
refs: https://github.com/wez/wezterm/issues/91
2020-05-30 09:40:44 -07:00
Wez Furlong
e09d223c7d wezterm: search: redefine trait method as async 2020-05-30 08:53:53 -07:00
Wez Furlong
cb3606d130 term: remove TerminalHost from api
This simplifies a bunch of things
2020-05-30 07:53:50 -07:00
Wez Furlong
d361b8a7c5 wezterm: add DisableDefaultAssignment action
Similar to Nop but allows the key press to pass through to
the underlying tab.

Expand docs to clarify how these two actions work.
2020-05-30 06:56:22 -07:00
Wez Furlong
b0ffa65727 wezterm: avoid scrolling to bottom on keypress when overlay is active
This helps preserve the viewport location after the search overlay is
closed.
2020-05-29 22:41:09 -07:00
Wez Furlong
7ff8d9e7a3 wezterm: search: select current match
When cycling through matches, set the current selection to the
matched range.  This doesn't implicitly copy; it just marks the
range.

You can use the `Copy` key assignment to explicitly copy the
selection to the clipboard.

I'm sort of on the fence about implicit copying.
2020-05-29 21:58:53 -07:00
Wez Furlong
e2c87c4b93 wezterm: search: ensure we perform the search when creating overlay
When pre-configured with a pattern, we need to execute it!
2020-05-29 09:32:51 -07:00
Wez Furlong
584ced1944 wezterm: search add regex as an pattern option 2020-05-29 09:24:30 -07:00
Wez Furlong
8b92fbdde3 wezterm: search ctrl-r cycles pattern matching mode
When the search overlay is active, pressing ctrl-r cycles through
the different pattern matching modes; currently case sensitive and
case insensitive, but shortly to add regex.

The search ui now also indicates the current mode.
2020-05-29 09:14:05 -07:00
Wez Furlong
7f83d2172c wezterm: add case insensitive search option 2020-05-29 09:06:04 -07:00
Wez Furlong
6b939c9048 wezterm: search: allow specifying pattern in key assignment
The default opens up search with an empty pattern in case sensitive
string matching mode.

The revised structure will allow doing things like eg: defining a key
assignment that searches for git hashes by regex.
2020-05-29 08:41:06 -07:00
Wez Furlong
44c3ee0e83 wezterm: search: fix cursor position to use grapheme width 2020-05-29 08:27:05 -07:00
Wez Furlong
633a4baad1 wezterm: fixup search result coords to be cell based indices 2020-05-29 08:24:04 -07:00
Wez Furlong
ed7b33d134 wezterm: fix pasting when an overlay is active
We would always send to the underlying terminal, which was wrong!
2020-05-29 08:18:36 -07:00
Wez Furlong
9f02e88de1 wezterm: simplify search API 2020-05-29 07:49:09 -07:00
Wez Furlong
9e89a557d4 wezterm: add disable_default_(key|mouse)_bindings config
If set to true, then none of the default key or mouse bindings,
respectively, will be registered in the GUI, leaving it up to
the user to provide all key assignments.
2020-05-28 22:22:02 -07:00
Wez Furlong
acd016cdd4 wezterm: send_composed_key_when_alt_is_pressed now defaults true
This should make our behavior more consistent with other terminal
emulators on macOS.

closes https://github.com/wez/wezterm/issues/158
2020-05-28 19:54:13 -07:00
Wez Furlong
9ff9bf15fd window: allow for stronger separation between raw and composed keys
The goal at the window layer is to preserve enough useful information
for other layers.  In this specific circumstance on macos we'd like
to be able know both that eg: ALT-1 was pressed and that ALT-1 composes
to a different unmodified sequence and then allow the user's key
binding assignment to potentially match on both.

We sort of allowed for this, but didn't separate out the modifier keys.
This commit adds a `raw_modifiers` concept to the underlying event
struct so that we can carry both the raw key and modifier information
as well as the composed key and modifier information.

In the scenario above, we want the raw key/modifier tuple to be ALT-1
but the composed key/modifier to be eg: unmodified `¡` in my english
keymap.

refs: https://github.com/wez/wezterm/issues/158
2020-05-28 19:35:50 -07:00
Wez Furlong
264ba0d8b6 wezterm: add --cwd option to the start subcommand
This allows for: `wezterm start --cwd c:/` to spawn the default
program explicitly in the `c:/` location, rather than the default
behavior for determining the cwd.

refs: https://github.com/wez/wezterm/issues/155
2020-05-28 08:08:31 -07:00
Wez Furlong
2f6d72899f wezterm: search: ctrl-n, ctrl-p to move through search results
refs: https://github.com/wez/wezterm/issues/91
2020-05-28 06:55:27 -07:00
Wez Furlong
5c0f568f84 wezterm: search: handle resizing better 2020-05-27 20:44:15 -07:00
Wez Furlong
c1c6ef6ddb Add scrollback search function
For the moment this is basic case sensitive substring matching,
but it is extensible to case insentive and regex matching.

refs: https://github.com/wez/wezterm/issues/91
refs: https://github.com/wez/wezterm/issues/106
2020-05-27 18:19:22 -07:00
Wez Furlong
81ededa9ac define basic search interface 2020-05-26 06:25:08 -07:00
Wez Furlong
b8acbac113 wezterm: add ClearScrollback key assignment
Bound to CMD-K and CTRL+SHIFT-K by default.  This also functions
while the output is filling up (eg: `find /` and hit the key binding
to keep pruning the scrollback).

closes: https://github.com/wez/wezterm/issues/194
2020-05-25 17:29:22 -07:00
Wez Furlong
3d1b52267e wezterm: teach updater about setup.exe 2020-05-25 12:55:59 -07:00