program main implicit none integer :: nCols integer :: stat call get_terminal_nCols(nCols, stat) if( stat == 0 )then print*, 'Column width: ', nCols else print*, 'Failed to get column width' endif end program main