You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Simon Law
6db30a10f7
cmd/tailscale: shrink QR codes using half blocks (#17084)
When running `tailscale up --qr`, the QR code is rendered using
two full blocks ██ to form a square pixel. This is a problem for
people with smaller terminals, because the output is 37 lines high.
All modern terminals support half block characters, like ▀ and ▄,
which only takes 19 lines and can easily fit in a regular terminal
window.
For example, https://login.tailscale.com/a/0123456789 is now rendered:
```
user@host:~$ tailscale up --qr
█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █ ▀▀ █▄▀▀ ▄ █ ▄▄▄▄▄ ████
████ █ █ █▀ ▄▄▄█▀█▄▀ ▄█ █ █ ████
████ █▄▄▄█ ██▄ ▄▀▀▄▄ ▀▀ ▀█ █▄▄▄█ ████
████▄▄▄▄▄▄▄█ ▀▄▀ █▄▀▄▀▄█ █▄▄▄▄▄▄▄████
████▄█▄ ▀▄▄▄█▀▄█▀ ▀▄ ▄ ▀▀ ▀▀▄█▄ ████
████▄▀▄▀▄█▄ █ ▄▄▄▄█▀██▀██▄▄█▀█▄▄▀████
████▄█▀ ▀ ▄█▄▄▀▄▀█ ▄ ▄█▀█▄▀██▄ ▀▀████
█████▀ ▀ ▄▀▀▀▀▄▀▄▀▀ ▄▄ ▄ ▀ █▄ ▄████
██████ ▄▄█▄▄▄▄▄▀ █ ▄▀▀▄█▀ █ ▄ ▀ █████
████▄█▄▄ ▄▀ ▀██▀ ▄█▀▀████▄▀█ ██████
█████▄▄▄█▄▄▄▀▀ █▄▄▄▄▄ ▀█ ▄▄▄ ▀▀████
████ ▄▄▄▄▄ █ ██▄ ▀ █▀█ ▄ █▄█ █▄█████
████ █ █ █▀ █ ▀█▄▄ █▀ ▄ ▀▄▀▄████
████ █▄▄▄█ █▄█▀█▄▀██▀██▄ ▀█▄▀▀▄▀▄████
████▄▄▄▄▄▄▄█▄▄███▄▄▄███▄▄▄██▄██▄█████
█████████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
```
To render a QR code with full blocks, like we did in the past, use the
new `--qr-format` flag:
```
user@host:~$ tailscale up --qr --qr-format=large
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
████████ ██ ████ ██ ████ ██ ████████
████████ ██████████ ██ ████ ██ ██ ██████████ ████████
████████ ██ ██ ████ ██████ ██ ██ ██ ██ ████████
████████ ██ ██ ██ ████████ ████ ████ ██ ██ ████████
████████ ██ ██ ████ ████ ████ ████ ██ ██ ████████
████████ ██████████ ██████ ██ ████ ██ ██████████ ████████
████████ ██ ██ ██ ██ ██ ██ ██ ██ ████████
████████████████████████ ██ ████ ██ ████ ████████████████████████
████████ ██ ██ ████ ████ ██ ████ ████ ██ ████████
██████████████ ████████ ████ ██ ██ ██████ ████████
████████ ██ ██ ██ ██ ██████████████ ██████ ██████████
██████████ ██ ██████ ██ ██████████ ████ ██████████ ██████ ████████
████████ ████ ██ ██ ██ ████ ██████ ██████ ████████████
████████████ ████████ ██ ██ ██ ████ ████ ██████ ████████
████████████ ██ ████████ ██ ████ ██ ██ ████████
██████████ ██ ██ ██ ████ ██ ████ ██████████
████████████ ██ ██ ██ ████ ████ ██ ██ ██████████
████████████ ████████████████ ██ ██ ████ ██ ██ ██████████
████████ ██ ██ ████████ ██████████████ ████ ████████████
████████████████ ██ ████ ████ ██████████ ██ ████████████
██████████ ██ ████ ██ ████ ████████████
████████████████████████ ████████████ ██ ██████ ████████
████████ ██ ████ ██ ██████ ██ ██ ██ ██████████
████████ ██████████ ██ ██████ ██ ██ ██ ██████ ██████████████
████████ ██ ██ ████ ██ ████ ████ ██ ██ ████████
████████ ██ ██ ██ ██ ██████ ██ ██ ██ ██████████
████████ ██ ██ ██ ██████ ████████████ ████ ████ ██ ████████
████████ ██████████ ██████ ████ ████ ██████ ████ ██ ██████████
████████ ██ ██████ ██████ ████ ████ ██████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████
```
Fixes #17083
Signed-off-by: Simon Law <sfllaw@tailscale.com>
|
7 months ago |
| .. |
|
cli
|
cmd/tailscale: shrink QR codes using half blocks (#17084)
|
7 months ago |
|
depaware.txt
|
feature/portmapper: make the portmapper & its debugging tools modular
|
7 months ago |
|
generate.go
|
cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS
|
3 years ago |
|
manifest_windows_386.syso
|
cmd/{tailscale,tailscaled}: embed manifest into Windows binaries
|
3 years ago |
|
manifest_windows_amd64.syso
|
cmd/{tailscale,tailscaled}: embed manifest into Windows binaries
|
3 years ago |
|
manifest_windows_arm64.syso
|
cmd/{tailscale,tailscaled}: embed manifest into Windows binaries
|
3 years ago |
|
tailscale.go
|
all: update copyright and license headers
|
3 years ago |
|
tailscale.rc
|
cmd/tailscale: add tailscale.rc Plan 9 wrapper
|
1 year ago |
|
tailscale_test.go
|
net/ipset, wgengine/filter/filtertype: add split-out packages
|
2 years ago |
|
windows-manifest.xml
|
cmd/{tailscale,tailscaled}: embed manifest into Windows binaries
|
3 years ago |