mirror of
https://github.com/wez/wezterm.git
synced 2024-09-21 03:39:16 +03:00
This commit is contained in:
parent
a4f07e6382
commit
8f2059e580
@ -21,6 +21,7 @@ As features stabilize some brief notes about them will accumulate here.
|
||||
* X11: wezterm now sets `_NET_WM_NAME` in addition to `WM_NAME` for clients that don't know how to fallback
|
||||
* [treat_east_asian_ambiguous_width_as_wide](config/lua/config/treat_east_asian_ambiguous_width_as_wide.md) for control over how ambiguous width characters are resolved. [#1888](https://github.com/wez/wezterm/issues/1888)
|
||||
* [clean_exit_codes](config/lua/config/clean_exit_codes.md) config to fine tune [exit_behavior](config/lua/config/exit_behavior.md) [#1889](https://github.com/wez/wezterm/issues/1889)
|
||||
* [ClearSelection](config/lua/keyassignment/ClearSelection.md) key assignment [#1900](https://github.com/wez/wezterm/issues/1900)
|
||||
|
||||
#### Changed
|
||||
* Debian packages now register wezterm as an alternative for `x-terminal-emulator`. Thanks to [@xpufx](https://github.com/xpufx)! [#1883](https://github.com/wez/wezterm/pull/1883)
|
||||
|
36
docs/config/lua/keyassignment/ClearSelection.md
Normal file
36
docs/config/lua/keyassignment/ClearSelection.md
Normal file
@ -0,0 +1,36 @@
|
||||
# ClearSelection
|
||||
|
||||
*Since: nightly builds only*
|
||||
|
||||
Clears the selection in the current pane.
|
||||
|
||||
This example shows how to rebind `CTRL-C` to copy to the clipboard
|
||||
when there is a selection present (clearing it afterwards) or sending
|
||||
CTRL-C to the terminal when there is no selection:
|
||||
|
||||
```lua
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
return {
|
||||
keys = {
|
||||
{
|
||||
key="c",
|
||||
mods="CTRL",
|
||||
action = wezterm.action_callback(function(window, pane)
|
||||
local has_selection = window:get_selection_text_for_pane(pane) ~= ""
|
||||
if has_selection then
|
||||
window:perform_action(
|
||||
wezterm.action{CopyTo="ClipboardAndPrimarySelection"},
|
||||
pane)
|
||||
|
||||
window:perform_action("ClearSelection", pane)
|
||||
else
|
||||
window:perform_action(
|
||||
wezterm.action{SendKey={key="c", mods="CTRL"}},
|
||||
pane)
|
||||
end
|
||||
end)
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue
Block a user