Avoid busy-wait in s:system_job() polling loop

Add sleep 10m to the job_status polling loop so it yields the CPU
instead of spinning at 100% while waiting for the job to finish.
This commit is contained in:
Jan Geboers 2026-02-18 17:01:54 +01:00
parent cf2d899500
commit 87dfcb2d21

View file

@ -2343,6 +2343,7 @@ function! s:system_job(cmd) abort
\ 'err_io': 'out',
\})
while job_status(job) ==# 'run'
sleep 10m
endwhile
let s:shell_error = job_info(job).exitval
let result = filereadable(tmp) ? join(readfile(tmp, 'b'), "\n") : ''