icholy/ttygif

xwd: unable to open display ' '

Closed this issue · 6 comments

I have make a terminal record by ttyrec myrecord and it can be played with ttyplay myrecord, but when I try to convert it to a gif by the command ttygif myrecord, it occurs a problem as following:

xwd:  unable to open display ''
failed to execute: xwd -id 23068679 -out /tmp/ttygif.o9dmWc/0.xwd

I have already executed export WINDOWID=23068679 before converting, and Installed those package with

yum install imagemagick gcc x11-apps xdotool

My environment is:

OS: CentOS release 6.8 (Final)
Arch: x86_64
ttygif: 1.4.0

Hope to reply, thanks ! 🙏

What happens when you run xwd directly with no parameters?

I typed xwd directly, the output is:

$ xwd
xwd:  unable to open display ''

Are you trying to do this over ssh?

I'm confused. I did this through a ssh connection to reach my real server, all I did is on the real server. 😕

That's your issue. The machine you're running it on needs to be running a X server so it can take a screenshot of the window (with xwd).

If the machine you're doing the ssh connection from is also Linux, you can scp the recording file to your local machine and do it from there.