Last active
December 2, 2016 06:48
-
-
Save mgor/b69dea465fc5b5f02a17f2ef20d47e27 to your computer and use it in GitHub Desktop.
test if terminal supports unicode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test_unicode() { | |
| echo -ne "\xe2\x88\xb4\033[6n\033[1K\r" | |
| # shellcheck disable=SC2034 | |
| read -d R foo | |
| echo -ne "\033[1K\r" | |
| echo -e "${foo}" | cut -d \[ -f 2 | cut -d";" -f 2 | ( | |
| read UNICODE | |
| [[ $UNICODE -eq 2 ]] | |
| ) 2>/dev/null | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment