I tried everything, the Snap version, the official .deb version. But the issue turned out to be related to GPU acceleration.
Disabling it solved my problem:
code --disable-gpu
you can permanently disable it in vscode settings:
"terminal.integrated.gpuAcceleration": "off"