Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m curious how the ergonomics of String handling were for this task. Swift’s String does extremely well to enforce correctness, and in isolation it’s really nice to use, but I’ve found it difficult to work with APIs that couldn’t care less about grapheme clusters or encodings. Or perhaps terminals are more Unicode-aware than I thought they were?


Terminals are definitely Unicode-aware. Grapheme clusters are very important to get right because the terminal emulator must be in sync with the app running inside it about where the cursor is located. Basically, this means you have to deal with combining marks properly, including Emoji stuff.

Very few terminal emulators go as far as attempting BiDi support. Egmont Koblinger has done some amazing work speccing this out and implementing it in VTE. More here: https://terminal-wg.pages.freedesktop.org/bidi/

Some day I'd like to support this in iTerm2, but it's a breathtakingly large amount of work.


Thank God for Unicode aware terminals! And with the emoji-heavy command-line tooling of today (yarn for example) I think terminals simply have to support extended grapheme clusters or face issues all the time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: