image: Use stty instead of sequence first.
This commit is contained in:
parent
2783446387
commit
94362674f2
2 changed files with 14 additions and 21 deletions
10
neofetch
10
neofetch
|
|
@ -3608,15 +3608,7 @@ get_window_size() {
|
|||
|
||||
get_term_size() {
|
||||
# Get the terminal size in cells.
|
||||
printf '%b' '\e[18t'
|
||||
IFS=';t' read -d t -t 0.05 -sra term_cells
|
||||
|
||||
lines="${term_cells[1]}"
|
||||
columns="${term_cells[2]}"
|
||||
|
||||
# Fallback to stty if above sequence isn't supported.
|
||||
[[ -z "$lines" || -z "$columns" ]] && \
|
||||
read -r lines columns < <(stty size)
|
||||
read -r lines columns < <(stty size)
|
||||
|
||||
# Calculate font size.
|
||||
font_width="$((term_width / columns))"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue