Ignoring the terminal capture for a moment and focussing on the gif part: how does it compare to LICEcap? I haven't used it in a while but development seems to have resumed[0].
On Linux, there is also peek[1], and on Windows, there is ScreenToGif[2]. Both are open source.
Another option is to use screencasting software like OBS Studio[3] (and for Linux, I highly recommend SimpleScreenRecorder[4]) to get a high-quality video capture, then throwing it through gifski[5] to get really high quality GIFs.
Especially if you plan on uploading to a gif-site you might as well just capture video and upload that - they tend to do gif-conversion themselves these days.
[0] https://www.cockos.com/licecap/
[1] https://github.com/phw/peek
[2] http://www.screentogif.com/
[3] https://obsproject.com/
[4] http://www.maartenbaert.be/simplescreenrecorder/
[5] https://gif.ski/