mirror of
https://github.com/neovim/neovim.git
synced 2026-07-21 00:21:38 +00:00
fix(terminal): don't poll for output during scrollback refresh (#38365)
Problem: If buffer update callbacks poll for uv events during terminal scrollback refresh, new output from PTY process may lead to incorrect scrollback. Solution: Don't poll for output to the same terminal as the one being refreshed.
This commit is contained in:
@@ -1153,6 +1153,7 @@ Integer nvim_open_term(Buffer buffer, Dict(open_term) *opts, Error *err)
|
||||
// displaying the buffer
|
||||
.width = (uint16_t)MAX(curwin->w_view_width - win_col_off(curwin), 0),
|
||||
.height = (uint16_t)curwin->w_view_height,
|
||||
.read_pause_cb = term_read_pause,
|
||||
.write_cb = term_write,
|
||||
.resize_cb = term_resize,
|
||||
.resume_cb = term_resume,
|
||||
@@ -1185,6 +1186,11 @@ Integer nvim_open_term(Buffer buffer, Dict(open_term) *opts, Error *err)
|
||||
return (Integer)chan->id;
|
||||
}
|
||||
|
||||
static void term_read_pause(bool pause, void *data)
|
||||
{
|
||||
// Not currently needed as sending to channel isn't allowed during buffer updates.
|
||||
}
|
||||
|
||||
static void term_write(const char *buf, size_t size, void *data)
|
||||
{
|
||||
Channel *chan = data;
|
||||
|
||||
Reference in New Issue
Block a user