1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00

rectangular selection: add option to select with Alt+Shift

This commit is contained in:
Funami580 2022-05-14 22:52:28 +02:00 committed by Wez Furlong
parent e927ecfd46
commit 9600d52cd8
4 changed files with 25 additions and 2 deletions

View File

@ -25,7 +25,7 @@ As features stabilize some brief notes about them will accumulate here.
* `wezterm cli list --format json` and `wezterm cli list-clients --format json` allow retrieving data in json format. Thanks to [@ratmice](https://github.com/ratmice)! [#1911](https://github.com/wez/wezterm/pull/1911)
* macOS, Windows: you may now drag and drop files from other programs and have their paths paste into the terminal. The new [quote_dropped_files](config/lua/config/quote_dropped_files.md) option controls how the file names are quoted. Thanks to [@junnplus](https://github.com/junnplus) and [@datasone](https://github.com/datasone)! [#1868](https://github.com/wez/wezterm/pull/1868) [#1953](https://github.com/wez/wezterm/pull/1953)
* The mouse scroll wheel now cycles between tabs when hovering over the tab tab. Thanks to [@junnplus](https://github.com/junnplus)! [#1726](https://github.com/wez/wezterm/issues/1726)
* Holding down `ALT` while dragging the left button will select a rectangular block. [ExtendSelectionToMouseCursor](config/lua/keyassignment/ExtendSelectionToMouseCursor.md) now accepts `"Block"` as a selection mode. [#1361](https://github.com/wez/wezterm/issues/1361)
* Holding down `ALT` while dragging the left button will select a rectangular block. It is also possible to use `ALT+SHIFT` to select a rectangular block. [ExtendSelectionToMouseCursor](config/lua/keyassignment/ExtendSelectionToMouseCursor.md) and [SelectTextAtMouseCursor](config/lua/keyassignment/SelectTextAtMouseCursor.md) now accept `"Block"` as a selection mode. Thanks to [@Funami580](https://github.com/Funami580) for helping! [#1361](https://github.com/wez/wezterm/issues/1361)
* In Copy Mode, `CTRL-v` will enable rectangular block selection mode. [#1656](https://github.com/wez/wezterm/issues/1656)
* Copy Mode: key assignments are [now configurable](copymode.md#configurable-key-assignments) [#993](https://github.com/wez/wezterm/issues/993)
* Search Mode: key assignments are [now configurable](scrollback.md#configurable-key-assignments) [#993](https://github.com/wez/wezterm/issues/993)

View File

@ -27,3 +27,6 @@ return {
[See Shell Integration docs](../../../shell-integration.md) for more details on
how to set up your shell to define semantic zones.
*Since: nightly builds only*
The mode argument can also be `"Block"` to enable a rectangular block selection.

View File

@ -32,7 +32,7 @@ that order.
| Double Left Down | `NONE` | `SelectTextAtMouseCursor="Word"` |
| Single Left Down | `NONE` | `SelectTextAtMouseCursor="Cell"` |
| Single Left Down | `SHIFT` | `ExtendSelectionToMouseCursor={}` |
| Single Left Down | `ALT` | `ExtendSelectionToMouseCursor="Block"` (*since: nightly builds only*) |
| Single Left Down | `ALT` | `SelectTextAtMouseCursor="Block"` (*since: nightly builds only*) |
| Single Left Up | `SHIFT` | `CompleteSelectionOrOpenLinkAtMouseCursor="PrimarySelection"` |
| Single Left Up | `NONE` | `CompleteSelectionOrOpenLinkAtMouseCursor="PrimarySelection"` |
| Single Left Up | `ALT` | `CompleteSelection="PrimarySelection"` (*since: nightly builds only*) |
@ -40,6 +40,8 @@ that order.
| Triple Left Up | `NONE` | `CompleteSelection="PrimarySelection"` |
| Single Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Cell"` |
| Single Left Drag | `ALT` | `ExtendSelectionToMouseCursor="Block"` (*since: nightly builds only*) |
| Single Left Down | `ALT+SHIFT` | `ExtendSelectionToMouseCursor="Block"` (*since: nightly builds only*) |
| Single Left Up | `ALT+SHIFT` | `CompleteSelection="PrimarySelection"` (*since: nightly builds only*) |
| Double Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Word"` |
| Triple Left Drag | `NONE` | `ExtendSelectionToMouseCursor="Line"` |
| Single Middle Down | `NONE` | `PasteFrom="PrimarySelection"` |

View File

@ -119,6 +119,24 @@ impl InputMap {
},
CompleteSelection(ClipboardCopyDestination::PrimarySelection)
],
[
Modifiers::ALT | Modifiers::SHIFT,
MouseEventTrigger::Down {
streak: 1,
button: MouseButton::Left
},
ExtendSelectionToMouseCursor(Some(SelectionMode::Block))
],
[
Modifiers::ALT | Modifiers::SHIFT,
MouseEventTrigger::Up {
streak: 1,
button: MouseButton::Left
},
CompleteSelectionOrOpenLinkAtMouseCursor(
ClipboardCopyDestination::PrimarySelection
)
],
[
Modifiers::NONE,
MouseEventTrigger::Up {