fix(terminal): check buf before deleting extmark #38314

Problem: buffer could be null when trying to delete "[Process exited]"
extmark

Solution: delete extmark only if buffer exists
This commit is contained in:
Ayaan
2026-03-16 03:11:05 +05:30
committed by GitHub
parent 1c57e4cb4f
commit 747da13f44

View File

@@ -680,7 +680,9 @@ void terminal_close(Terminal **termpp, int status)
// only need to call the close callback to clean up the terminal object.
only_destroy = true;
// Buffer may be reused so delete the "[Process exited]" msg
extmark_del_id(buf, (uint32_t)-1, term->exitmsg_id);
if (buf) {
extmark_del_id(buf, (uint32_t)-1, term->exitmsg_id);
}
} else {
// flush any pending changes to the buffer
if (!exiting) {