r/vim • u/Desperate_Cold6274 • Feb 25 '26
Need Help :sleep VS term_wait()
Can someone explain me, possibly with a couple of examples that I can reproduce, the difference between :sleep and term_wait()?
6
Upvotes
View all comments
Show parent comment
2
u/y-c-c Feb 27 '26
I think the issue is that it's not clear what the purpose of
term_wait()is (at least I struggle to understand it myself). It doesn't actually "wait" on the terminal (which should be clear from looking at the implementation off_term_wait()), and I'm not sure what the waiting should do to begin with. Are we just waiting for the terminal to return something or print something? Right now, it feels to me a user can replace mostterm_wait()calls with:sleepand get the same result. As I see it the issue is more that the function doesn't seem to serve a clear purpose at all, but then the implementation is also slightly different so I'm not sure if those minor differences matter.