I just installed betterTerm to use with code_runner on Windows 11.
Commands sent via \betterTerm.send() types the command to terminal but requires manual Enter to execute.
This appears to be due to \n being sent without \r so the appended CR isn't being recognised on Windows.
Adding \r to turn it into \r\n resolves the issue locally (here's my quick fix):
if vim.loop.os_uname().sysname == "Windows_NT" then
local ok, bt = pcall(require, "betterTerm")
if ok and bt and not bt.__patched_for_cr then
bt.__patched_for_cr = true
local orig = bt.send
bt.send = function(command, index, press)
-- force a CR so shells that ignore LF still execute
return orig((command or "") .. "\r", index, press)
end
end
end
I’m happy to open a PR if this approach is acceptable.
I just installed betterTerm to use with code_runner on Windows 11.
Commands sent via
\betterTerm.send()types the command to terminal but requires manual Enter to execute.This appears to be due to
\nbeing sent without\rso the appended CR isn't being recognised on Windows.Adding
\rto turn it into\r\nresolves the issue locally (here's my quick fix):I’m happy to open a PR if this approach is acceptable.