Commit Graph
266 Commits
Author SHA1 Message Date
Wez Furlong 6a5f203e4b Fix an issue where a config reload would trigger a cascade of reloads
The last config reload time didn't seem to stick in the periodic timer
callback.

Need to investigate that further, and also see if the blink paint
time is similarly impacted.
2020-01-06 14:08:14 -08:00
Wez Furlong c7aa8cd845 fix some warnings 2020-01-06 11:42:09 -08:00
Wez Furlong 93256f3339 fix lingering after closing down
The root cause of this was a bit of a hack to ensure that we didn't
prematurely shut down while waiting for ssh sessions.

Introduce an Activity token that will extend the lifetime of the
event loop even if there are no windows present.

This cleans things up both on macos the application would linger in
the application switcher until you had tabbed away and back again,
and also for the null frontend which had grown a less gross hack.
2020-01-06 11:37:41 -08:00
Wez Furlong 2f6f3ed933 restructure to avoid borrow error
Rust maintains the borrow from the match expression for the lifetime of
the match blocks, even though there is no relationship between the
value in scope in the blocks :-/

Having separate statements makes things happier.
2020-01-06 10:00:46 -08:00
Wez Furlong b07babb335 Closing a window closes the window, rather than the tab
refs: https://github.com/wez/wezterm/issues/101
2020-01-06 00:03:01 -08:00
Wez Furlong 8419862f12 track selection per tab again
Selection got accidentally moved to be scoped by window during
the remodel.  This commit moves it to the per tab state.

refs: https://github.com/wez/wezterm/issues/89
2020-01-05 23:23:26 -08:00
Wez Furlong f38e39134e reinstate scroll to bottom on input behavior
This was temporarily disabled as part of the mux datamodel changes
2020-01-05 18:17:06 -08:00
Wez Furlong fe0b9bde86 fix selection row when viewport is scrolled back 2020-01-05 17:31:45 -08:00
Wez Furlong ac2c8aadf6 fix an issue where the cursor would appear in the tab bar
If the cursor was in the first non-tab bar row, we'd incorrectly render
it in the same column on both rows.
2020-01-05 16:23:03 -08:00
Wez Furlong bda0a3b5fe windows: remove DoubleClick from input enums
double clicks weren't registering correctly with the new selection
logic.  Tell windows that we're doing all our own click counting
and simplify the logic.
2020-01-05 16:16:06 -08:00
Wez Furlong 4687b3bb48 clippy 2020-01-05 15:14:32 -08:00
Wez Furlong 94b78a47c8 mux: workaround a spurious panic notification with ssh connections
The issue is that when we start the proxy mode up, we haven't set
up a frontend, and the ssh client wants to kick off a non-essential
task via the executor.

This commit starts up a null frontend in proxy mode so that that
machinery is present.

Then, because we don't register any tabs with the mux, we need to
adjust the behavior of the null frontend to not terminate when
the mux has no tabs.

It's a little gross.
2020-01-05 14:37:17 -08:00
Wez Furlong dfa2b08c72 move URL highlight processing to the gui layer 2020-01-05 14:37:17 -08:00
Wez Furlong d79455c2b4 switch most of the rest of the mux over to the new model
This mostly works, but has a cache invalidation issue wrt.
passing invalidated rows from the server to the client...
sometimes.

However, scrollback is cached on demand and selection works.
2020-01-05 14:37:17 -08:00
Wez Furlong 66b8b774f5 partially connect new data to mux rpc layer 2020-01-05 14:37:17 -08:00
Wez Furlong 400c8aa66d remove explicit dirty manipulation from Renderable
This commit leaves mux domains broken for the moment,
but also simplifes the implementation of the renderable interface.
2020-01-05 14:37:17 -08:00
Wez Furlong e4fed76bd1 instrument painting and rpc calls 2020-01-05 14:37:17 -08:00
Wez Furlong c5a8531a91 fix mouse cursor after changing the selection logic
We weren't setting the cursor to an I-beam
2020-01-05 14:37:17 -08:00
Wez Furlong 6db31d5f64 implement triple click selection 2020-01-05 14:37:17 -08:00
Wez Furlong fac3c3c719 implement double click word selection 2020-01-05 14:37:17 -08:00
Wez Furlong 02ab0f1c3e Implement select and copy 2020-01-05 14:37:17 -08:00
Wez Furlong 5a605ea5c5 render selection locally
This enables drag to select and rendering of the selection.

Actually copying it is still TODO, as is double and triple click
handling.
2020-01-05 14:37:17 -08:00
Wez Furlong 55e4050aa3 use LastMouseClick for paste click counting 2020-01-05 14:37:17 -08:00
Wez Furlong 17b2c49c68 rearrange more mouse event code 2020-01-05 14:37:17 -08:00
Wez Furlong 48d971c106 pull click counting code up from terminalstate 2020-01-05 14:37:17 -08:00
Wez Furlong f1089e84bf Middle button always pastes if shift is held 2020-01-05 14:37:17 -08:00
Wez Furlong fa9f699d46 rearrange mouse coordinate math
Move it up so that we can reference it in a later diff
2020-01-05 14:37:17 -08:00
Wez Furlong a8bf11a825 add Selection types to the gui layer
These are still unused

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 4912e83f3e StableCursorPosition to track the cursor
This fixes up the cursor position when scrolling.

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 12b537d2c8 serde_derive -> serde with derive feature 2020-01-05 14:37:17 -08:00
Wez Furlong ef072255dd Process shift+pageup/down at the gui layer
Refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 6183434bda Track viewport in the gui layer
Use StableRowIndex to implement tracking the viewport in the gui layer.
This resolves an issue where a busy terminal would continue to scroll
through the scrollback when you were paging backwards and look weird.

There's still some cleanup though:

- This breaks the selection ui
- the cursor position is wrong when scrolling back
- shift-pageup/pagedown need to be processed in the gui layer

Refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 39dc6516df simplify key_event logic a little
Early return and remove some explicit return statements
2020-01-05 14:37:17 -08:00
Wez Furlong e8d46442ac move mouse wheel scroll handling to gui layer
It's not really moved, but rather duplicated there; we still have
fallback logic in terminalstate.rs that processes the equivalent
action, but adding the logic to the gui layer means that we can
process it in terms of the Tab and Renderable interfaces.

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong bafa36b8ca simplify middle mouse button paste logic
Now that we can tell whether the mouse is grabbed, we can safely
process the paste in the same way that we use for keyboard initiated
pasting.
2020-01-05 14:37:17 -08:00
Wez Furlong 5f5113ce50 Renderable: fold get_scrollbar_info into get_dimensions 2020-01-05 14:37:17 -08:00
Wez Furlong 56c170240f Renderable: replace a 2-tuple with an expanded struct
This cleans up the API a little as part of
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong 8d3e513ed8 Ensure that the scroll thumb is well defined when disabled
When the scrollbar is disabled we still create a quad for it, and that
quad stretches to the window height.  It is left with undefined texture
and could be either partially or totally transparent and lead to weird
effects like it appearing as though the titlebar was too wide for the
window, or by dimming the RHS of the window when toggling the scroll
bar on and off a few times.

This commit ensures that we set a well defined size and color when
the scroll bar is disabled, and seems to improve things for me.

Refs: https://github.com/wez/wezterm/issues/103
2020-01-02 11:20:42 -08:00
Wez Furlong 364fc147be Instant::elapsed() 2019-12-31 15:56:41 -08:00
Wez Furlong 253c36bf8c use duration_since per @jsgf 2019-12-31 15:38:57 -08:00
Wez Furlong 6b78d1ad27 Implement tab movement via key assignment
This commit adds the ability to change the relative or absolute
position of a tab within its containing window through the
use of a key assignment.

We include a default assignment of CTRL+SHIFT+PageUp for moving
left and CTRL+SHIFT+PageDown for moving right.

Closes: https://github.com/wez/wezterm/issues/84
2019-12-31 15:31:50 -08:00
Wez Furlong cc27f3f902 Only highlight cells that use exactly the highlight URL
If the cells refer to the same object instance (rather than equivalent
instances), then we treat them as part of the same highlight.

Refs: https://github.com/wez/wezterm/issues/94
2019-12-31 14:35:36 -08:00
Wez Furlong 699d092a6b Ignore mouse clicks that coincide with window focusing
Now that we can track focus changes, we can eliminate an annoyance:
clicking in the window to focus it would cause a click event to
be passed to the terminal and clear the selection.

This commit will swallow button events that occur within 200ms
of the focus being gained by the window.
2019-12-31 14:11:09 -08:00
Jeremy Fitzhardinge 887991f464 Remove BlockOutline cursor style
Not really needed, since its something we can handle at rendering time.
2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge 999ba79436 Use non-focused cursor shape for unfocused windows 2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge a499eedb86 Make sure cursor gets refreshed properly on focus change 2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge 6d5fbf93ff Define outline cursor for unfocused use 2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge 0bc0972f75 Track focus state and disable cursor blinking when not focused
Issue https://github.com/wez/wezterm/issues/93
2019-12-29 16:58:15 -08:00
Jeremy Fitzhardinge 962b74c458 Only blink cursor when it's not moving
The cursor should only start blinking when its been sitting in once place;
a moving cursor should always be visible. Rather than making the cursor blink
relative to the creation time of the window, track its position, and use the
last time it moved as the blinking timebase.

Fixes https://github.com/wez/wezterm/issues/83
2019-12-29 09:38:59 -08:00
Wez Furlong 5d55b8bc2e Ensure that the scrollbar defines more vertex fields
This is a bit of a speculative change to see if it helps with
refs: https://github.com/wez/wezterm/issues/82

I have sometimes seen my scrollbar have a color that I didn't
choose and ISTR having some issues in the past when updating
the quads if I didn't set all of the fields of the vertex
to a better defined value.
2019-12-28 12:15:48 -08:00