Live data from Hacker News

Everything you ever wanted to know about terminals

xn--rpa.cc

11–20 of 191 posts

Re: Everything you ever wanted to know about terminals

#11

Off-topic, but it would be nice if HN could properly parse the Punycode encoding of internationalized domain names, so rather than the URL appearing as xn--rpa.cc, it appeared properly as ʞ.cc

Interestingly it's not even showing in Chrome for me. Shows fine in Safari.

I wonder if Chrome considers the upside down "LATIN SMALL LETTER TURNED K" potentially deceptive.

They've apparently got a whole document about what Chrome will and won't display

https://chromium.googlesource.com/chromium/src/+/main/docs/i...

Re: Everything you ever wanted to know about terminals

#12
I was aware of the ANSI escape sequences and even used them directly in scripts on occasion, but I still used ncurses "where it mattered" because I didn't know about compatibility. I didn't want to risk Windows or a random flavor of linux I'd never heard of or a group of anti-VT100 enthusiasts getting upset because I didn't use an agreed upon compatibility layer.

From the tone of this piece I gather that the ANSI escape codes are actually standard enough to target. Cool! Thanks for the heads up.

Re: Everything you ever wanted to know about terminals

#14
I was working on terminal code recently and had a hell of a time finding anything approaching an authoritative spec or reference docs. The best I found was this: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

I'd recommend that over the wikipedia link in the article, since wikipedia seems to be missing some things.

Re: Everything you ever wanted to know about terminals

#15

Off-topic, but it would be nice if HN could properly parse the Punycode encoding of internationalized domain names, so rather than the URL appearing as xn--rpa.cc, it appeared properly as ʞ.cc

there are tools like dnscrypt-proxy or nfq which allow you to sinkhole any punicode dns domains (before DoH became a thing) and I'm glad that some browsers still show this as xn-- as it's now the only defense that stands between users clicking on hxxps://аррӏе.com instead of https://apple.com

punicode was a terrible idea to allow in DNS.

Re: Everything you ever wanted to know about terminals

#16

I was aware of the ANSI escape sequences and even used them directly in scripts on occasion, but I still used ncurses "where it mattered" because I didn't know about compatibility. I didn't want to risk Windows or a random flavor of linux I'd never heard of or a group of anti-VT100 enthusiasts getting upset because I didn't use an agreed upon compatibility layer. From the tone of this piece I gather that the ANSI esc…

> From the tone of this piece I gather that the ANSI escape codes are actually standard enough to target.

termfo[1] comes with a "termfo" CLI utility which – among other things – can group terminals by escape code; for example "termfo find-cap save_cursor" shows that almost all terminals use "\x1b7", with just a few very old ones using something different (full output is a bit long, but it's at [2]).

It's useful to check "can I safely hard-code this escape code?" But like you said: for ANSI it's pretty safe to just hard-code most codes, especially the common ones, but never hurts to check.

[1]: https://github.com/arp242/termfo

[2]: https://pastebin.com/raw/pVHGR6aZ

Re: Everything you ever wanted to know about terminals

#17
post #11

Off-topic, but it would be nice if HN could properly parse the Punycode encoding of internationalized domain names, so rather than the URL appearing as xn--rpa.cc, it appeared properly as ʞ.cc

Interestingly it's not even showing in Chrome for me. Shows fine in Safari. I wonder if Chrome considers the upside down "LATIN SMALL LETTER TURNED K" potentially deceptive. They've apparently got a whole document about what Chrome will and won't display https://chromium.googlesource.com/chromium/src/+/main/docs/i...

Firefox shows the raw punycode too. If I owned that domain I'd be mildly annoyed.

Re: Everything you ever wanted to know about terminals

#18

Off-topic, but it would be nice if HN could properly parse the Punycode encoding of internationalized domain names, so rather than the URL appearing as xn--rpa.cc, it appeared properly as ʞ.cc

there are tools like dnscrypt-proxy or nfq which allow you to sinkhole any punicode dns domains (before DoH became a thing) and I'm glad that some browsers still show this as xn-- as it's now the only defense that stands between users clicking on hxxps://аррӏе.com instead of https://apple.com punicode was a terrible idea to allow in DNS.

>punicode was a terrible idea to allow in DNS

This is a very western-centric viewpoint. Most of the world does not use the Latin alphabet as its primary writing system.

Re: Everything you ever wanted to know about terminals

#19
You can't have "everything you wanted to know about terminals" with absolutely no mention of terminfo and (previously) termcap.

You don't necessarily need ncurses to have a portable smart terminal experience, but you do need terminfo.

ncurses magic relies on the lore stored in terminfo, which contains all of the obscure escape sequences and other information about the disparate world of terminals.

They're maintained as a combined package, but you don't need ncurses to drive the screen. You can get the codes yourself if that's what you want to do. You can use tput to make colorful labels in shell scripts.

While much of the world has moved on to the One Terminal running on the One OS, not everyone has.

Re: Everything you ever wanted to know about terminals

#20

Earlier quoted context omitted.

there are tools like dnscrypt-proxy or nfq which allow you to sinkhole any punicode dns domains (before DoH became a thing) and I'm glad that some browsers still show this as xn-- as it's now the only defense that stands between users clicking on hxxps://аррӏе.com instead of https://apple.com punicode was a terrible idea to allow in DNS.

>punicode was a terrible idea to allow in DNS This is a very western-centric viewpoint. Most of the world does not use the Latin alphabet as its primary writing system.

it is a security centric view point not a "Western" one.
Post reply on HN