惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
Recent Announcements
Recent Announcements
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
博客园_首页
The Cloudflare Blog
M
MIT News - Artificial intelligence
博客园 - 【当耐特】
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题
P
Proofpoint News Feed
Y
Y Combinator Blog
Jina AI
Jina AI
博客园 - 聂微东
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
F
Full Disclosure
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Microsoft Security Blog
Microsoft Security Blog
爱范儿
爱范儿
T
Tailwind CSS Blog
J
Java Code Geeks
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
宝玉的分享
宝玉的分享
IT之家
IT之家
Hacker News: Ask HN
Hacker News: Ask HN
The Register - Security
The Register - Security
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs

Lobsters

CIFSwitch: a non-universal Linux local root vulnerability RIPE NCC session fixation: poaching logins with an Atlas probe GNOME 2.20 but its Web Components Agentic Search for Context Engineering – Leonie Monigatti Garnix is shutting down [not OC] akashina.tngl.sh/jjc Concerning Emacs (and Jazz) Nitpicking the shell history scene in ‘Tron: Legacy’ What's cooking on SourceHut? Q2 2026 The tenth OpenPGP email summit Package managers that package package managers Clojure on Fennel part three: parsing WordPress at 23 Finding Miscompiles for Fun, Not Profit GitHub - creusot-rs/creusot: Creusot helps you prove your Rust code is correct. Announcing Rust 1.96.0 | Rust Blog A Love Letter to Neovim sqlite AGENTS.md Am I a Bad Friend? CSS vs. JavaScript • Josh W. Comeau Erlang Ecosystem Foundation - Supporting the BEAM community A brief note about slot access cost in Common Lisp Keyboard latency probe Rethinking the GNOME clipboard issues Back to the Building Blocks’ Building Blocks Tech Notes: Theseus: translating win32 to wasm Fast is better than slow Content-addressed Rust builds (or, what kache actually caches) Intent to Prototype: Embedding API Canada’s Bill C-22 and the security cost of collecting more data 5 PostgreSQL locking behaviors that trip people up okmij.org Stop advertising in your commits! | AksDev GitHub - mplsllc/macsurf: A modern web browser for Classic Mac OS 9 PowerPC. Real CSS3, ES5 JavaScript, native HTTPS — built with CodeWarrior on the Carbon API. Introducing DoomBench - Can Your Data Stack Run DOOM? What are some of your favourite developer tools? Building a Scalable Ingestion Pipeline with Temporal (Part 1) Converting shallow Git bundles into normal repositories Are you a member of any professional associations? What is a harmonic? An interactive comic about additive synthesis How Virtual Tables Work in the Itanium C++ ABI Using SwiftUI to Build a Mac-assed App in 2026 Rust (and Slint) on a jailbroken Kindle. ~jack/lambda-on-lambda - Serverless Haskell on AWS - sourcehut git Human proof for FOSS contributions Extremely simple internet radio controlled via IRC Announcing BABLR Splitting Konsole views from Helix to run tools | AksDev GitHub - yugr/rust-slides Serving files over HTTP three ways: synchronous, epoll, and io_uring update docs with information about building with build.py (#979) · astral-sh/python-build-standalone@c9c40c5 A Simple Makefile Tutorial On C extensions, portability, and alternative compilers Switching to Colemak | Pedro Alves Just How Bad Was The Intel IAPX432? Nix's Substituter List Is Not a Routing Table Accelerating copy_if using SIMD Lambda on Lambda: Serverless Haskell on AWS | Blog Announcing feed-repeat v1.0 Scaling Akvorado BMP RIB with sharding EYG news: A host of CLI improvements, new guides and new effects The social contract of writing JS Crossword C array types are weird; and related topics Flatpak will depend on systemd – OSnews Migrating from Go to Rust | corrode Rust Consulting A portentous reunion Vivado Licensing Options How my minimal, memory-safe Go rsync steers clear of vulnerabilities the entropy layer of a wavelet codec, on its own GitHub - nferhat/fht-compositor: A dynamic tiling Wayland compositor. Debian SE Linux and PinTheft Does bulk memmove speed up std::remove_if? (No.) 声明式部分更新 | Blog | Chrome for Developers Fully in-browser container builds Dianne Skoll's Web Site - Remind The Architecture of Open Source Applications (Volume 1)Berkeley DB Pardon MIE? - ironPeak Blog “Long-Term Support” doesn’t mean what you think Jira IS Turing-Complete May I recommend thinking of Emacs as your Fortress of Solitude hershey Floodgap Gopher-HTTP gateway gopher://thelambdalab.xyz/1cuneiforth/ HP QuickWeb, Singular And Pointless That one time I used Go panics for flow control A new suite of modern tools coming for editing and publishing RFCs From the Tabletop… The Digital Antiquarian Building a Host-Tuned GCC to Make GCC Compile Faster Are we self-sovereign PKI yet? Claw Patrol: an open-source security firewall for agents | Deno Revised^7 Report on Scheme, Large: Procedural Fascicle Draft is now public A Network Allow-List Won't Stop Exfiltration — André Graf From AFSK to Goertzel – µArt.cz Software For My New Home Server Introducing Neptune: Direct3D virtualization for QEMU AI Agent Bankrupted Their Operator While Trying to Scan DN42 - Lan Tian @ Blog mimalloc: A new, high-performance, scalable memory allocator for the modern era Making wl_shm fast The Soul of Maintaining a New Machine - Third Draft | Books in Progress What is Git made of?
all the ways in which terminals' text rendering is bad
ecs.d2evs.ne · 2026-06-17 · via Lobsters

terminals really want text to be a 2d grid of characters which can be rendered by just mapping each character onto a box on the screen. now, if your language uses a latin script, this can probably be made to work good enough. unfortunately, it turns out that language is complex, orthography is complex, and if you try to generalize this approach to text rendering to handle unicode properly, you're gonna end up with Problems

with that in mind, let's try to generalize this approach to text rendering to handle unicode properly

wait hang on you said a 2d grid of "characters" what even is a character

great question! this one's actually relatively straightforward: a character is 7 bits encoded as a byte in ascii, with the high bit's meaning depending on the way the terminal is configured

... by which i mean that a character is actually a unicode codepoint, encoded in utf8, which can take up a variable number of bytes in memory but it's fine because we can still think of it as a fixed-width integer

... by which i mean that it's actually an extended grapheme cluster (egc), which is a variable-length sequence of codepoints, but it's fine because we can still reliably define it without any machine-specific context, purely using universally-accepted data and algorithms

... by which i mean that it's actually whatever the font says it is. oops. though do bear in mind that if you're writing an application, you do still want to do most of your unicode handling (such as eg. arrow key movement) based on extended grapheme clusters

terminals have gotten better at this, and at the very least understanding utf8 rather than ascii is table stakes for modern terminal emulators, but support for ligatures is still very much hit-or-miss and egc support is Somewhat Dubious

yep! text is really quite simple like that

... wait oops sorry i got mixed up it's the opposite of the thing i said

so afaik there's not a whole lot of effort that's been put into standardizing this sort of thing. there're some areas we'll get to later where terminals tend to do the Wrong Thing, but at least that Thing has a pretty consistent consensus between everyone on what the standard behavior is. this is not one of those cases

unicode defines a property called "east asian width", which is mostly just for marking cjk characters that're square rather than rectangular, and which doesn't handle emojis correctly. the historically-standard way of doing this has been to calculate text width on a per-codepoint level, which is definitely incorrect. foot does this but limits it to 2, which is more correct (though i'm not sure if it's Actually correct)

as a bonus, any changes in this algorithm which aren't reciprocated on both sides of the terminal protocol can and will lead to cursor desyncs. the only way that i know of to build a unicode-robust program which doesn't rely solely on the terminal's built-in text placement involves the Worst hacks

a description of said hacks

ok sure, so "character" is a messed-up concept. but surely the "2d grid" part is fine, right?

nope! it's completely impossible for terminals to use non-monospace fonts because of this. there are some benefits to a monospace font in some contexts, but forcing everyone to use them all the time is... not optimal

as a bonus, modern text rendering has given up entirely on the assumption that text can be coerced into a 2d grid of any sort, which means that when we try to fit text back into that box, we stop being able to rely on any widely-used algorithms for text width in this context. joy.

alright, so characters are messed up, and 2d grids are messed up, but surely so long as the characters do happen to be the same width everything will work out?

nope! terminals completely break with rtl text, and while this is a bit less inherent to the fundamental building blocks of how terminals work, in practice fixing it would require rewriting the text-rendering parts of every single tui program in existence, on top of quite a bit of work to fix cli programs without forcing them to start thinking about text rendering in too much detail

ugh, that sucks. how can we fix it?

honestly i don't think we can, and even if we can, i'm not sure if it's worth it. terminals suck for a bunch of other reasons in addition to their poor unicode handling, and i'd much rather see a wholesale replacement for them which tries to keep the good parts without being shackled to backwards-compatibility with hardware from the '50s

and there are good parts of terminals, to be clear. small cli programs are really easy to write without having to think about the interface, even if that default interface isn't ideal, and i'd really like to see something which can keep that programmer-ease-of-use for simple cases

i also rather like plan9's approach to this: windows can have both text and pixels written to them, and text mode has none of the complexity that's required to be able to implement fullscreen programs in it. things which look and feel like tui programs are instead just drawing directly to the same window that until recently had a shell running in it, and because of this they aren't limited to a monospace grid of unicode characters. i would, however, like to see the text mode expanded a little bit from what plan9 has in order to better accommodate keyboard-only usage