Failed to execute Terminal Emulator. Input/Output error.

I have installed Xfce4 desktop environment in server.
When i am opening terminal and closing, it is showing above error.
Reason:
Your system's default terminal emulator (the one set by update-alternatives) is:
-
missing
- broken
- misconfigured
- the executable was deleted
- package is half-installed (common after emergency mode)
So when the console tries to spawn a terminal → it fails with I/O error.
Solution:
sudo update-alternatives --config x-terminal-emulator
Select xfce-terminal and it works.
