Terminal Emulator Crashes on Resize in Xfce4
Your terminal emulator crashing when you resize the window is usually a VTE library bug. Here's the fix that works 90% of the time.
Quick answer
Set VTE_CJK_WIDTH=1 in your environment or downgrade VTE to version 0.68.3 or earlier.
Why it happens
I've seen this on Xfce4 Terminal, GNOME Terminal, and even some lightweight ones like Sakura. The culprit here is almost always VTE (Virtual Terminal Emulator) library version 0.68.4 to 0.70.x. These versions have a bug in the CJK (Chinese/Japanese/Korean) character width calculation. When you resize the window, the terminal recalculates column widths, and that code path hits a null pointer. Boom — crash. It's not your terminal emulator's fault, it's VTE's.
This usually happens when you're running a terminal on a system with a non-UTF-8 locale or mixing CJK fonts. But I've also seen it on pure UTF-8 systems with standard fonts. Snapping the window to a screen edge or dragging the corner fast triggers it more often.
Step-by-step fix
- Check your VTE version
Runapt list --installed 2>/dev/null | grep vteon Debian/Ubuntu, orrpm -qa | grep vteon Fedora/RHEL. If it's 0.68.4 or higher, you're affected. - Set the CJK width environment variable
Edit your shell config file (~/.bashrc,~/.zshrc, or/etc/environment) and add:
Then reload:export VTE_CJK_WIDTH=1source ~/.bashrc. This forces VTE to use the old CJK width calculation. Problems from this are rare — I've never seen any. - Test it
Close all terminals, open a new one, resize aggressively. If it still crashes, move to the alternative fix.
Alternative fix: Downgrade VTE
If the env var doesn't work, you need to downgrade the VTE library. On Ubuntu/Debian:
sudo apt install libvte-2.91-0=0.68.3-1 libvte-2.91-common=0.68.3-1Pin the version so it doesn't update automatically:
sudo apt-mark hold libvte-2.91-0 libvte-2.91-commonOn Fedora, you'll need to grab the older RPM from a repo like koji. I don't recommend that unless you're comfortable. On Arch, downgrade with downgrade AUX package and pin it in /etc/pacman.conf.
If you can't downgrade (e.g., on a rolling release that forces newer libraries), switch to a terminal emulator that doesn't use VTE. Good alternatives: Alacritty (uses its own renderer), Kitty (uses OpenGL), or rxvt-unicode (urxvt, old but solid, uses Xterm widget). You'll have to reconfigure your colors and fonts, but at least it won't crash.
Prevention tip
Set VTE_CJK_WIDTH=1 in /etc/environment before you even see the crash. It's harmless and keeps your terminal stable across VTE updates. Also, don't run rolling release distros on production machines — they push buggy VTE versions first. Stick to LTS releases for critical work.
Was this solution helpful?