Commit Graph
1795 Commits
Author SHA1 Message Date
Wez Furlong bcf3d8db35 remove some dead code 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 1c716898e7 Remove viewport_offset from RenderableDimensions
refs: https://github.com/wez/wezterm/issues/106
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 1b3ced2ab3 Add StableRowIndex concept
This will make it easier to manage both the viewport and the
selection in the gui layer.

refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong a0ad0d0c34 terminalstate: remove middle click paste handling
This is safely performed 100% by the gui layer now.
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 5ba0c70cdb add Tab::is_mouse_grabbed concept
refs: https://github.com/wez/wezterm/issues/106
2020-01-05 14:37:17 -08:00
Wez Furlong f1846ab0ae add Renderable::get_lines
This allows retrieving arbitrary lines from the scrollback

refs: https://github.com/wez/wezterm/issues/106
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
Jun Wu 318267c88b Fix negative cursor movement
I noticed moving-up does not work and tracked it down here.
2020-01-05 14:18:08 -08:00
Jun Wu ef1b836441 Drop unnecessary mut from WindowsTerminalWaker::wake
This matches `UnixTerminalWaker`.
2020-01-04 14:04:56 -08:00
Jun Wu 0ac59cb44c Remove unused dependency
Detected by `cargo-udeps`.

I was wondering why @markbt/streampager requires `jpeg-decoder`.
2020-01-03 22:55:05 -08:00
Wez Furlong e424a4ce6c x11: improve default wheel distance per tick
On x11 we'd get just a single line per scroll wheel tick.
Contrast with Wayland where we get multiple.

This config change makes us feel more snappy by default on X11.

I'd like to make this configurable using the live configuration
infra, but we don't currently have a way for this crate to see
that config, so this just changes the default to be "better".

refs: https://github.com/wez/wezterm/issues/92
2020-01-02 11:32:26 -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 b5e410e843 wayland: normalize clipboard to unix line endings on copy 2020-01-02 11:08:16 -08:00
Wez Furlong 0db15ecaf4 wayland: fix spurious resize event on focus change
The resize event would be fine except that it happens to trigger
the scroll position to reset to the bottom.
2020-01-02 11:03:12 -08:00
Wez Furlong ce5e69cb8f Update tab video to show tab bar 2019-12-31 19:04:59 -08:00
Wez Furlong 01561916c4 add screenshot of imgcat 2019-12-31 18:33:24 -08:00
Wez Furlong 12a4961b5c fix video url in the docs 2019-12-31 18:13:59 -08:00
Wez Furlong 4b4683b1af fix focus messages on Windows
Use SETFOCUS/KILLFOCUS rather than ENABLE.

Closes: https://github.com/wez/wezterm/issues/93
2019-12-31 17:28:51 -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 ecc6840061 add note about tab movement to the change log 2019-12-31 15:35:11 -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
Wez Furlong 8485e5db0c docs: maybe do a better job at caching mdbook 2019-12-30 15:12:51 -08:00
Wez Furlong b4b24aacca suppress warning 2019-12-30 11:11:41 -08:00
Wez Furlong 3f2e29b024 macos: fix keyboard repeat issue with backspace
wtf?  Not sure why this only impacted backspace
2019-12-30 11:09:19 -08:00
Wez Furlong 5540b2e66b Don't default to swapped backspace and delete on macos
With the changes in Refs: https://github.com/wez/wezterm/issues/88
we don't need to swap them by default on macos any more.
2019-12-30 10:33:52 -08:00
Wez Furlong d58f1ff5dc Implement focus_change for macos
Refs: https://github.com/wez/wezterm/issues/93
2019-12-30 10:32:12 -08:00
Wez Furlong f09145756c Add note about backspace handling to the changelog for nightly 2019-12-30 08:40:31 -08:00
Wez Furlong a396a64550 Revert "wayland: implement focus_change callback"
This reverts commit bfa8d0c207,
which proved not to be needed because it was already covered
by the `KeyboardEvent::Enter` and `KeyboardEvent::Leave` handling.
2019-12-30 08:35:52 -08:00
Wez Furlong f0e94084d1 change backspace/delete handling
Previously we would try to pass through the Backspace and Delete
code points without interference, but that behavior wasn't quite
right.

With this commit our behavior is now:

- At the window layer: Classify a `Backspace` key press as logically
  `BS` and a `Delete` key press as logically `DEL` unless the
  `swap_backspace_and_delete` is true (macOS is true by default), in
  which case `Backspace` is mapped to `Delete` and vice versa.

- At the terminal input layer: A `Backspace` input from the Window sends
  the `DEL` sequence to the pty as that matches the default `VERASE` stty
  configuration.  A `Delete` input from the Window emits `\033[3~`,
  which matches up to the `TERMINFO` for `xterm-256color` which we
  claim to be compatible with, and is our default `$TERM` value.

The net result of this is that `Backspace` will now start to emit `^?`
which should match folks stty verase.   Heads up to @fanzeyi!

I've tested this only on a linux system so far and will follow up on
a macOS system a little later today.

Refs: https://github.com/wez/wezterm/issues/88
Refs: https://github.com/wez/wezterm/issues/63
2019-12-30 08:14:20 -08:00