From 386032bdee7ff200802520da1e44e1d67410adda Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 1 Jan 2021 20:07:46 -0800 Subject: [PATCH] docs: fix custom event example --- docs/config/lua/wezterm/on.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/config/lua/wezterm/on.md b/docs/config/lua/wezterm/on.md index 3e431615f..6be440f06 100644 --- a/docs/config/lua/wezterm/on.md +++ b/docs/config/lua/wezterm/on.md @@ -39,12 +39,12 @@ in response to clicking on `mailto:` URLs, you could do something like: local wezterm = require 'wezterm'; wezterm.on("open-uri", function(window, pane, uri) - local start, end = uri:find("mailto:") + local start, match_end = uri:find("mailto:") if start == 1 then - local recipient = uri:sub(end+1) - window.perform_action(wezterm.action{SpawnCommandInNewWindow={ + local recipient = uri:sub(match_end+1) + window:perform_action(wezterm.action{SpawnCommandInNewWindow={ args={"mutt", recipient} - }}); + }}, pane); -- prevent the default action from opening in a browser return false end