-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: blank preview w/ glow 1.5.0 #107
Conversation
lua/glow.lua
Outdated
end | ||
end, | ||
}) | ||
job_id = vim.fn.termopen(cmd, term_opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was hoping to not use this function anymore since it brings a really bad Process Exited [0]
msg at the end of the preview. The nvim_open_term
function was fixing that, but with the new glow version, that stopped working. Can we stick with the old behavior somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, Process Exited [0]
is less than ideal. I'll see if there is a way to avoid that message at the end of the preview. In the meantime, I'll convert this to a draft.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ellisonleao I believe I have an updated solution that successfully leverages nvim_open_term
so that we can avoid Process Exited [0]
.
@pynappo I'm also curious if this helps resolve the behavior you were seeing on Windows (or if it introduces new/different issues). This works for me on Linux.
b3171ae
to
a3032a9
Compare
02a40b8
to
466f3d5
Compare
466f3d5
to
362dbf1
Compare
cc @ellisonleao friendly bump |
lua/glow.lua
Outdated
local function on_output(err, data) | ||
if err then | ||
-- what should we really do here? | ||
print("[Glow Error] " .. vim.inspect(err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use vim.api.nvim_err_writeln
here instead of print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutely!
Thanks @pyqlsa |
While using the semantics introduced in 83f1840, glow 1.5.0 is immediately
SIGTERM
'd upon execution ofjobstart()
. During testing, it was observed that the introduction ofpty = true
to the options forjobstart()
would allow for successful execution while leveraging the linked executions semantics (avoiding theSIGTERM
), but output would render very slowly (~2-5 seconds). Avoiding thejob_control
semantics and leveragingvim.loop
directly appears to allow for successful output presentation and avoid delayed output rendering.This PR also bumps the glow version to
1.5.0
.