Skip to content

Commit

Permalink
docs: fix custom event example
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Jan 2, 2021
1 parent b8cabc5 commit 386032b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/config/lua/wezterm/on.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 386032b

Please sign in to comment.