Converted all terminal functions to use inttypes.h