feat(wezterm): error when wezterm is unable to get scrollback

This commit is contained in:
Price Hiller 2023-08-31 18:37:49 -05:00
parent fe9544c23f
commit d870ca4c1f
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -5,6 +5,10 @@ wezterm.on("trigger-nvim-with-scrollback", function(window, pane)
local scrollback = pane:get_lines_as_text(scrollback_lines) local scrollback = pane:get_lines_as_text(scrollback_lines)
local name = os.tmpname() local name = os.tmpname()
local f = io.open(name, "w+") local f = io.open(name, "w+")
if f == nil then
window:toast_notification("Wezterm", "Unable to get scrollback!", nil, 4000)
return
end
f:write(scrollback) f:write(scrollback)
f:flush() f:flush()
f:close() f:close()