blinry on Nostr: I'm building a tiny terminal emulator from scratch, to better understand how they ...
I'm building a tiny terminal emulator from scratch, to better understand how they work!
And I found something cool: My backspace key wasn't working. I was sending ASCII 0x8 to `sh`, but it just replied with "^H".
Turns out you can change that! `stty -a` showed me that the erase character was set to "^?" (whatever that is). So I changed it with `stty erase ^H", and now it works!
`sh` even outputs the sequence <backspace><space><backspace>, like a typewriter "overtyping" a letter with a space!
Published at
2024-12-03 16:01:17Event JSON
{
"id": "137328ce5e77e14cae4596a7383e46d74f67e29c0260c115bc77732df7ac8994",
"pubkey": "35ca9beb10f6282bdc518bc22ac2966b915af41e372314e89f32f2db4a5a4689",
"created_at": 1733241677,
"kind": 1,
"tags": [
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/113/589/710/672/254/853/original/7bf6a1bc0684fb7d.png",
"m image/png",
"dim 1197x482",
"blurhash U27n2T^~xss.j[oeazoe9Jt5xsWCt5j[t5az"
],
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/113/589/713/226/737/183/original/b69ac46d4b402de2.png",
"m image/png",
"dim 891x260",
"blurhash U297eJ-:019H4pE1~o?a?Z-:4pD*IaIo?Z-."
],
[
"proxy",
"https://chaos.social/users/blinry/statuses/113589726599124921",
"activitypub"
]
],
"content": "I'm building a tiny terminal emulator from scratch, to better understand how they work!\n\nAnd I found something cool: My backspace key wasn't working. I was sending ASCII 0x8 to `sh`, but it just replied with \"^H\".\n\nTurns out you can change that! `stty -a` showed me that the erase character was set to \"^?\" (whatever that is). So I changed it with `stty erase ^H\", and now it works!\n\n`sh` even outputs the sequence \u003cbackspace\u003e\u003cspace\u003e\u003cbackspace\u003e, like a typewriter \"overtyping\" a letter with a space!\n\nhttps://assets.chaos.social/media_attachments/files/113/589/710/672/254/853/original/7bf6a1bc0684fb7d.png\nhttps://assets.chaos.social/media_attachments/files/113/589/713/226/737/183/original/b69ac46d4b402de2.png",
"sig": "8b7d641a91ecd05880fe6a1448f3a0a847b1b7e307764ae7f8b2340336cb36eac5c54f6062eeebad38d83c554f6c9e694867750b22033433bbeed13630068fa3"
}