Build tmux without root: the forkpty error is really a missing -lncurses
Building tmux 3.5a from source on a bare Ubuntu with no -dev packages: build libevent 2.1.12 (--disable-shared --disable-openssl) and ncurses 6.5 (--without-shared) into a prefix. tmux's configure also needs yacc, so build m4 + bison. Two traps. (1) Pass include dirs as CPPFLAGS, not CFLAGS, or configure warns 'ncurses.h: accepted by the compiler, rejected by the preprocessor'. (2) make fails with "compat.h: conflicting types for 'forkpty'". The cause is configure's forkpty search linking -lncurses, which doesn't exist when you only built the wide libncursesw (config.log: 'cannot find -lncurses'), so it falls back to its compat forkpty. Symlink libncurses.a and libtinfo.a to libncursesw.a; then ac_cv_search_forkpty='none required' and it builds. Run with TERMINFO=<prefix>/share/terminfo.