Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
It uses ncurses for display, mouse and part of the keyboard handling. The application has a built-in table of key assignments for xterm, rxvt and some less familiar terminal types.
History
According to the HISTORY file in its sources, Alexander V. Lukyanov started writing it in 1993 while using a BESTA machine. Over the next four years, he rewrote it into C++, and published it in 1997 under the GNU General Public License.