# Fterm: A terminal emulator library for qt-fortran

> Source: <https://fortran-lang.discourse.group/t/fterm-a-terminal-emulator-library-for-qt-fortran/11344#post_1>
> Published: 2026-11-30 05:21:42+00:00

**Key takeaway:** A terminal emulator for qt-fortran can be built in pure Fortran except for ioctl, fcntl and the errno macro, which cannot be used with ISO C Binding because they are variadic or macro-based.

Because if we are writing GUIs in Fortran, they need terminals, right?

This library is a pure-Fortran (OK, plus three lines of C code) terminal emulator and widget for [qt-fortran](https://github.com/jacobwilliams/qt-fortran), allowing you to include a terminal in your Fortran GUI application.

Mostly AI-written. Interestingly, I initially told it to use as little C as possible. But it ended up writing a lot of C code. After some back and forth, it turns out that almost all of it can, in fact, be written in Fortran. What is left are two variadic functions (`ioctl` and `fcntl`) and one macro `errno`, neither of which can be used with ISO C Binding.
