Closed iambumblehead closed 3 months ago
@xaizek to loop you in
I tried this from the bash bible again and this time it work. I must have done something wrong the last time I tried using it...
get_window_size() {
# Usage: get_window_size
printf '%b' "${TMUX:+\\ePtmux;\\e}\\e[14t${TMUX:+\\e\\\\}"
IFS=';t' read -d t -t 0.05 -sra term_size
printf '%s\n' "${term_size[1]}x${term_size[2]}"
}
it looks like the above function only returns a valid value interrmittently
$ resolution_window_get
469x696
$ resolution_window_get
^[[4;469;696t469x696
$ resolution_window_get
469x696
$ resolution_window_get
469x696
$ resolution_window_get
^[[4;469;696t469x696
$ resolution_window_get
^[[4;469;696t469x696
$ resolution_window_get
^[[4;469;696t469x696
$ resolution_window_get
^[[4;469;696t469x696
$ resolution_window_get
469x696
the script still needs to be updated to use terminal-reported cell size but a separate/new issue and PR can be created for that.
per https://github.com/vifm/vifm/issues/419#issuecomment-1983049450
google-searching shows that this returns rows and columns
stty size
and this does work here in foot terminal and xterm. There is also $LINES and $COLUMNS env vars.But how should window resolution should be detected
update: the function above does not return resolution from vifm-spawned script call :(