Skip to content

Commit

Permalink
get-terminal-theme: increase timeout to 1 second
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Oct 24, 2023
1 parent 0615c65 commit e6f3417
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/get-terminal-theme
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ function get_terminal_theme() (
# read -t 1 data
# echo data = $data
# }
IFS=: read -s -t "$(get_read_decimal_timeout 0.01)" -d $'\a' -p $'\e]11;?\a' _ color </dev/tty || :
#
# use a timeout of 1 seconds, as 0.01 is too slow for vscode tunnels, which causes the respond to be to tty and not captured, causing a false guess to them... as [get-terminal-theme] now has a cache, the larger timeout is not a big deal
IFS=: read -s -t 1 -d $'\a' -p $'\e]11;?\a' _ color </dev/tty || :
if test -n "$color"; then
# Fetch the first two characters of [1a]74/[2b]98/[3c]b6 which is our color, and convert from hexadecimal to decimal
# For what the latter two characters are, no one seems to know: https://unix.stackexchange.com/q/754952/50703
Expand Down

0 comments on commit e6f3417

Please sign in to comment.