var stty = `stty -a`; var lines = stty.match(/\brows\h+(\d+)/); var cols = stty.match(/\bcolumns\h+(\d+)/); say "#{lines} #{cols}";