Better HN
topnewbestaskshowjobs
Log inSign up

joshka

2,498 karma · joined Jun 6, 2011 (15y ago) · 1,377 submissions

[ my public key: https://keybase.io/joshka; my proof: https://keybase.io/joshka/sigs/ElI6j13SI-_2rTrkLnoKyV-uDepH4JvAQAzp2OWV_W0 ]
Submissions

comment 4d ago · link · parent

Can you get good diffs in the UI, for every turn, and never run into detached head stuff, assumptions about git etc. Does creating threads have to be told not to make worktrees? Do you have to tell it not to make temporary clones because it wigs out about uncommitted files in the current folder. This is just a small sampling of problems you get with using Claude / Codex with JJ. In general, tooling that assumes git makes design choices based on that which are just a little wrong.

JJ is much better, and I want the tooling to support it better, but it's not there yet in general.

comment 1w ago · link · parent

> The NSA did not immediately return a message seeking comment about the reported outage.

Did you try sending it via outlook.com?

comment 1w ago · link · parent

I've actually done a full ghostty rust rewrite, it works. If anything I'd use that as a basis.

See https://github.com/joshka/qwertty-term/. I probably won't keep it updated though as tracking a moving target is tough.

Not quite sure I follow your improvements / need. I'm not really doing anything in the web gpu space though.

comment 1w ago · link · parent

Me too - though I switched to the Fastmail app a while ago. The one thing that it's missing is a back / forward stack.

comment 1w ago · link · parent

> Oh I didn't know you were the author of that too! I tried your original version for my Kitty-heavy needs and it didn't work for that, just like vhs didn't.

Betamax now supports kitty image protocol pretty well. Should be even better when libghostty-vt for rust drops the 1.0 version. Happy to take issues on it if there's missing bits.

> Not sure if you do this with betamax, but it has been absolutely sick using ntrecord in agent loops. The LLMs make themselves tapes to get to a state and then can look at it to validate or improve. I don't even ask them anymore, they just do the whole thing themselves. I've fixed charting bugs and improved TUI browser conformance this way.

Yup - it's pretty neat to watch the agent build out Ratatui widgets like https://www.joshka.net/ratatui-diff/ with zero code being seen during the process and steering via only screenshots etc. Documented the process here: https://www.joshka.net/betamax/testing/visual-development/

comment 1w ago · link · parent

I stopped using the TUI as the Codex app surpassed it for all my use cases including writing TUI stuff. I let it spin up betamax and give me PNGs / GIFs of output to validate in the transcript.

When I was using the Codex CLI, usually had the TUI open in a VSCode terminal window and would run 4-10 windows. The app cut that effort down a bunch.

I've since moved to using T3 Code, though I do use the ChatGPT app to access dots and ChatGPT Pro, but that's about it.

> Thanks for Ratatui, which certainly has a top tier name

The name predates my involvement in the project by about 1 week :D

> [1] Viewing the gloss README in the Gloss web viewer (Golang WASM in a Ghostty frame), press 't' to typeset it. Alpha release quality. https://nimbleterminal.github.io/gloss/app.html?src=https%3A...

neat :)

comment 1w ago · link · parent

Yep. This is fairly reasonable take. Though it should be noted that ECMA-48 doesn't really go into any detail on how / what those items do beyond naming them in the table.

I mention at the end of the post that I'm not wedded to anything in the protocol other than it's what I implemented as a PoC. The exact mechanism isn't the key part that matters. Only the outcome of colored border fragments matters to me.

One part of this though that is pretty necessary is detection of the available modes as the fallback characters to use have to be fairly manual.

comment 1w ago · link · parent

> Snark and a winky face emoticon really negate any insight you could have provided here. These types of comments are becoming too frequent here.

I added the ;) after posting to indicate some amount of good humor. Feel free to read it how you like, but I'm not here to provide insight to someone that literally said they didn't read the post as their first ever comment on this site. Was this your alt?

> No one said don't do anything new.

No. It's literally the first line of the comment I replied to:

> I'm specifically referring to maintainers trying to get new protocols (like border draw calls) into emulators.

> Multiple people said that a proposed new feature to a standard should have proved value, and that patching a standard and its related tools could be a sign the feature isn't as needed as you think.

For some actual insight - I don't think that requiring a standard to have proved itself is a good place to be here. It's literally what I'm asking for here. Find a way to prove this out. Does it work, does it fail in some bad ways. I don't care about the 'make this a standard part'. I literally wrote "I'm not attached to this being the exact solution, but I think it's a problem worth solving, and I'd like it to be more than one terminal's feature (and more than one weekend's worth of yak shaving)." in TFA.

We're living in an age where experimentation is cheap. We can look at ways to find out if these things are valuable by trying them. My blog post isn't about making a standard a standard, we're a long way from that here, it's about working out if it's something people would find interesting and useful in the terminal. As a library maintainer in that space, having seen many many terminal user interfaces, I feel identifying gaps like this is a necessary part that makes things move forward. One thing to note is that experimentation down a path doesn't mean that that path will be accepted / used / useful. We do that in software all the time - HTML blink tag, DHTML, Java Applets, ...

comment 1w ago · link · parent

I agree. We should definitely never do anything new. Just stop right here. ;)

comment 1w ago · link · parent

Yeah, that's pretty janky - missed it in editing.

I've made the point elsewhere that the actual spec is the the bit I care least about on this. There's multiple ways that are valid for actually doing it - DCS, ASC, SGR, CSI, Overtype, etc. - the point of it is to argue for the outcome borders that are are between the cells not using one.

comment 1w ago · link · parent

I definitely missed a bunch of AI generated prose in there. But I did my best to read most of it and pull out anything egregious that felt off. If you throw it into any AI detection software it will probably come up as 100% AI written. I write fairly verbosely regardless of AI.

comment 1w ago · link · parent

Neat - yeah, I recall futzing around with character rom stuff in the early 8086 days too, being able to peek and poke character drawing locations to do custom cell graphics was pretty magical. The problem with it for this sort of thing is that fonts are more than raster things these days, you don't have an 8x8 grid to play with. But that said, take a look at what raph is doing with rio. https://x.com/raphamorims/status/2120887890129388001

comment 1w ago · link · parent

Good find. Thanks for the validation. I expect there's ways to make this reasonably performant on most terminals. It's the adoption part that really matters on this. I mentioned elsewhere that doing ghostty, kitty, rio, would be fairly simple. But that's like 5% of the terminal user's market. xtermjs for vscode would be meaningful. But Terminal.app and Windows terminal would be a much tougher hill to climb.

comment 1w ago · link · parent

Thanks - will take a watch

comment 1w ago · link · parent

By "find", I meant "expose" - i.e. terminal coding agents tend to make these flaws evident because they're trying to do the right combination of things in the TUI where there are painful annoyances and tradeoffs that can't be easily resolved at the application level.

comment 1w ago · link · parent

The big ones I see are:

- When you write cells, you don't have an area of the screen that you can treat as the current area, which makes screen readers have to treat the screen as characters and recompose those back into words to read. You lose any rectangular area concept and treat lines in the terminal as lines that the screen reader reads. Semantically you throw away all the layout information by writing to the terminal.

- When you write stuff to the screen and then write enough lines to the screen to push lines into the scrollback, you lose the ability to change those lines in future. You can move the cursor anywhere in the screen viewport, but not anywhere outside of it. Scrollback is dead text once written there. This is fine for most apps that need append logic, but less so where you have reasons to treat the terminal as a space where you update it or gain access to things like expanding info. e.g. pick up claude code or codex and think about how you collapse a diff or command output to headers and then expand it, in the viewport, not a problem, in the scrollback it's dead text written once.

- There's a mismatch in the way that wrapping works when applied to the screen. If you're wrapping text at the screen boundary, and letting the terminal select across lines, it hits the edge of the terminal, and wraps to the next line. There's no concept of the edge of a block, because cells are the base level primitive. This affects selecting text, copying it, etc.

- Resizing terminals after stuff has written requires repainting the existing screen and then taking care about what was written to the scrollback history. E.g. if you have 200x50 and resize to 200x49, the top line just entered the scrollback and is now part of the history that you can't edit. Unless you clear the entire scrollback and repaint. Again similar problem and reasons. Resizing to 199x50 is worse, because you lose a character on each line, and push stuff into scrollback. And also the opposite 200x51, you just pulled a line from the scrollback now, so now you have to consider what to write back to that line later - what was dead is now alive again. These problems make writing terminal coding agents that rely on having interactive parts of the screen and history parts of the screen tough.

- Scrolling in general. If you look at how each terminal scrolls, and how many lines it maps to each mouse scroll wheel action, it differs per terminal, and it differs based on mouse / trackpad use as well. The events you get are not standardized in count, frequency, acceleration, ... This makes doing anything related to scrolling when you own the entire screen and scroll state a pain as you're trying to emulate the terminal's native feel and that differs a bunch. So there's a strong missing abstraction over scroll state things instead of just plain mouse events. Having a terminal and app level collaborate to tell where the scroll is up to is the approach that seems to be necessary here.

A lot of this comes from the fact that terminals are a mix of standards tracing back many years, stacked on top of each other, implemented poorly or not at all, ECMA, VT, DEC, iTerm, Kitty, OSC, ASC, DCS, SGR, ... and they all deal in cells being the basic primitive rather than the higher level semantic thing you need to do a TUI that is region aware. That's a impedance mismatch that is hard to bridge without a new standard that just sidesteps it completely.

If you look at the history of Codex / Gemini / Claude Code, they've each run into this problem a bunch over time and solved various bits of it / ignored other bits of it.

comment 1w ago · link · parent

> We need a terminal compositor protocol. We need to leave the pty behind and replace it with a unix socket. What other compositing protocols exist in the modern tech stack that we could extend?

I think there was some discussion about this last time I mentioned the idea on hn a few weeks / months back. Trawl my history to find it pehaps.

comment 1w ago · link · parent

This is not as bad an idea as it would seem, but it's never going to happen with Unicode. It could reasonably happen with a combination of NerdFonts / private area shenanigans + cell rendering on the terminal side of this to handle it.

It solves the z-index problem neatly for an individual cell as you just render in order (first underneath, second over the top). But it doesn't solve the order for adjacent cells - borders that lie between cells. At least not easily. Not an insurmountable problem.

Some perspective if you're unaware. Fonts have the unicode line drawing characters, but fonts don't align super well and so a good terminal will draw those characters with line drawing algorithms instead of as a font. I've got a WIP PR that I need to land in VSCode's that pulls in xtermjs and ghostty's line drawing stuff so that it fixes up all the existing gaps on that as an example of this problem.

comment 1w ago · link · parent

Similar yes

comment 1w ago · link · parent

It should be coming soon. :) Sometime in the next couple of weeks is the vague handwavy forecast.

comment 1w ago · link · parent

This was intentional to highlight the borders more obviously.

The test app has a key to turn that off see https://github.com/joshka/ratatui/blob/joshka/cell-borders/C...

The side gaps were for for making it feel balanced in the screenshots and visualizations to be able to show where the borders line up with cells easily etc. It wouldn't be what I'd use in a real app.

One thing to note though is that some things which are "wrong" can be aesthetically pleasing to look at and may be the actual best UX in certain situations. There's a lot of new design principle work (especially in macOS / iOS) that is about things going past the edge, or being overlaid with floating things. Some of this is "wrong" some of it is wrong, and some of it sitting in in the useless gap beteen the two. ;)

comment 1w ago · link · parent

The ratatui change was a pure PoC, isolated branch, my own fork, not the ratatui repo even. This would likely never ship as a default approach as it would be way too breaking. I haven't really spent any time on making it hook into the current block border approaches - it's just at the cell level where this is opted in. That will never merge without much much more though into things.

I used ratatui there mostly so that I could prove that it would work in real looking apps that do panels and similar stuff that benefits from borders.

But yeah, compat is key. It would probably go out to ghostty, rio, kitty pretty easily, terminal.app never, other terminals much slower. IDK about the windows / linux side of things.

comment 1w ago · link · parent

Sure - I use GUIs most of the time despite maintaining Ratatui. I much prefer them for coding agents as the amount of interactions and various things I want out of the interface are not handled by TUI well. GUIs are a vastly superior interface (I worked on the Codex TUI at OpenAI btw).

comment 1w ago · link · parent

What I'd really love to see instead of all of this is an OS that has composable areas that can interact and have event loops of their own. E.g. ditch the app boundary and compose. We're getting there sorta with AI Canvas type things (e.g. github copilot app, some of the stuff in chatgpt visualizations), but all of this sort of work tends to devolve to browser type things instead of simpler components. This is mostly unrelated to the terminal side of things though from my perspective on this. But it's a fun thought experiment.

comment 1w ago · link · parent

For a while in the 2000s I tried programming with Verdana in my IDE at the time. It wasn't all that bad. It would be in a terminal however - fun idea regardless.

comment 1w ago · link · parent

Which things do you consider in your experience of writing tuis that are mentioned as being wanted in the blog post / rationale doc linked to be unnecessary?

If you want those things then overstrike is insufficient.

comment 1w ago · link · parent

I kinda keep talking about it in the hopes that someone will be nerd sniped enough to throw tokens at it as an idea. Sort of what you're probably doing too I guess. ;)

comment 1w ago · link · parent

I upvote naysayers comments there as I don't think votes should be used to indicate (dis)agreement at least not without commenting why, more an indication that this is a useful thing to discuss. So if you see my comments not getting votes while every other one has a bump, that's my vote on them :)

It's kind of funny, I posted this here and there at similar times. Expected to be spam flagged there due to the anti-AI brigade, but my submission here was the one that actually got hit (likely because I disclosed AI use in the post body is my guess).

comment 1w ago · link · parent

The big thing to note on this is one last caveat. I don't care about the actual spec on this - happy for that to be whatever works. I care more about the capability than how it's done / implemented.

There's some bits that feel like they probably make sense to consider doing other ways, like how border placement works (inside, outside, on the border, etc.), and how the filling works - to make borders incorporate external or internal padding.

comment 1w ago · link · parent

Nothing really - Ghostty has a bit of padding that's unused per cell - 16 bits. The implementation stores an ID into a lookup table with border combinations. If all of those were used and never cleaned up, 65535 at around 100 for each combination used, order of magnitude 25MB absolute worst case assuming no real optimization in place for this.
12345
46