top | item 46700179

(no title)

EMM_386 | 1 month ago

The problem is they are using the Ink library which clears and redraws for each update.

https://github.com/anthropics/claude-code/issues/769

I locally patched the closed-source CLI npm package but it's not perfect. They would have to switch how their TUI is rendered on their side.

Apparently OpenAI Codex is rust+ratatui which does not have this issue.

discuss

order

thomasahle|1 month ago

I'm always surprised that Python doesn't have as good TUI libraries as Javascript or Rust. With the amount of CLI tooling written in Python, you'd think it had better libraries than any other language.

wonger_|1 month ago

Blessed was a decent one iirc:

https://github.com/jquast/blessed

One reason for the lack of python might be the timing of the TUI renaissance, which I think happened (is happening?) alongside the rise of languages like Go and Rust.

behnamoh|1 month ago

it has, but python being single threaded (until recently) didn't make it an attractive choice for CLI tools.

example: `ranger` is written in python and it's freaking slow. in comparison, `yazi` (Rust) has been a breeze.

Edit: Sorry, I meant GIL, not single thread.

blks|1 month ago

I’m using Textual for my TUI needs, it’s very decent.

jschlatter|1 month ago

They started with Ink but have since switched to their own renderer:

> We originally built Claude Code on Ink, a React renderer for the terminal. [...] Over the past few months, we've rewritten our rendering system from scratch (while still using React).

https://github.com/anthropics/claude-code/issues/769#issueco...

cududa|1 month ago

Thanks for sharing. Very … interesting. Just trying to understand why the heck would React be the best tool here?

lifetimerubyist|1 month ago

React?!

Good grief get me off this sloppy ride.

behnamoh|1 month ago

then maybe they should've bought and fixed Ink instead of bun, just saying!

reissbaker|1 month ago

FWIW, Ink is working on an incremental rendering system: they have a flag to enable it. It's currently pretty buggy though unfortunately. Definitely wish Anthropic would commit some resources back to the project they're built on to help fix it...