MCJack123 / craftos2

A fast, modern, and feature-filled ComputerCraft emulator written in C++.
https://www.craftos-pc.cc
Other
230 stars 27 forks source link

CraftOS-PC becomes unresponsive when the frozen terminal gets resized. #345

Open simadude opened 7 months ago

simadude commented 7 months ago

Describe the bug CraftOS-PC becomes unresponsive when the frozen terminal gets resized. The issue does not depend on the GraphicsMode set.

To Reproduce Steps to reproduce the behavior:

  1. Freeze the terminal using term.setFrozen(true).
  2. Try to resize the terminal.
  3. CraftOS-PC will now become unresponsive and use 100% of one of the cores of the CPU. Here is the code that may reproduce it:
    term.setFrozen(true)
    for i = 1, 100 do
    os.pullEventRaw()
    end
    term.setFrozen(false)

Expected behavior CraftOS-PC should not become unresponsive upon resizing.

Screenshots image (Going step by step through debugger, which also becomes unresponsive at the end together with the terminal)

Environment:

Additional context The issue became first apparent to me when I tried to resize the terminal while running my game engine Obsi with graphics mode on my own fork. This issue is replicatable on Accelerated version of the CraftOS-PC that wasn't compiled from source.