fix(#487): avoid terminal id collisions in __add (#490)

This commit is contained in:
Will Hopkins 2023-09-10 23:27:56 -07:00 committed by GitHub
parent b2b234941a
commit 6bec54e738
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,6 +216,7 @@ end
---@package
---Add a terminal to the list of terminals
function Terminal:__add()
if terminals[self.id] and terminals[self.id] ~= self then self.id = next_id() end
if not terminals[self.id] then terminals[self.id] = self end
return self
end