general: Faster read on newer bash

This commit is contained in:
Dylan Araps 2018-10-17 14:57:40 +11:00
parent caea0f059c
commit afc29ac448
1 changed files with 4 additions and 1 deletions

View File

@ -3573,7 +3573,10 @@ get_window_size() {
# user input so we have to use read to store the out # user input so we have to use read to store the out
# -put as a variable. # -put as a variable.
# The 1 second timeout is required for older bash # The 1 second timeout is required for older bash
IFS=';t' read -d t -t 1 -sra term_size case "${BASH_VERSINFO[0]}" in
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
*) IFS=';t' read -d t -t 1 -sra term_size ;;
esac
unset IFS unset IFS
# Split the string into height/width. # Split the string into height/width.