wezterm ctrl+click to url
This commit is contained in:
parent
91aa5c41f0
commit
241bc58783
1 changed files with 24 additions and 0 deletions
|
@ -23,6 +23,7 @@ in {
|
|||
fonts = config.modules.desktop.fonts.fonts;
|
||||
in ''
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
local config = {}
|
||||
|
||||
|
@ -43,6 +44,29 @@ in {
|
|||
font_size = ${toString fonts.sansSerif.size}
|
||||
}
|
||||
|
||||
config.mouse_bindings = {
|
||||
-- Change the default click behavior so that it only selects
|
||||
-- text and doesn't open hyperlinks
|
||||
{
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'NONE',
|
||||
action = act.CompleteSelection 'ClipboardAndPrimarySelection'
|
||||
},
|
||||
-- and make CTRL-Click open hyperlinks
|
||||
{
|
||||
event = { Up = { streak = 1, button = 'Left' } },
|
||||
mods = 'CTRL',
|
||||
action = act.OpenLinkAtMouseCursor
|
||||
},
|
||||
-- Disable the 'Down' event of CTRL-Click to avoid weird program behaviors
|
||||
-- https://wezfurlong.org/wezterm/config/mouse.html#gotcha-on-binding-an-up-event-only
|
||||
{
|
||||
event = { Down = { streak = 1, button = 'Left' } },
|
||||
mods = 'CTRL',
|
||||
action = act.Nop
|
||||
}
|
||||
}
|
||||
|
||||
return config
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue