Open patrick-kidger opened 3 months ago
@patrick-kidger , we added a terminal, and it's available in the latest version of marimo. Thanks for opening this issue!
Nice! Poking around a bit I've found this PR:
https://github.com/marimo-team/marimo/pull/1786
which I assume is what you're referencing. I can see that this adds a terminal button to the bottom of the webpage.
What's the appropriate way to wire up the terminal to the output of a cell? (So that e.g. the code snippet above works.)
Sorry, I misunderstood your original issue after pattern matching on xterm.js
.
stdin
in marimo is indeed not a terminal. What you're asking for should be possible, but it's a nontrivial amount of work on the backend.
Description
Here's a quick MWE for a program that errors out when ran from Marimo. I'm using
prompt_toolkit
as a popular example of a library that requires terminal emulation. (I'm using threading just to work around #1746.)Context
For context, a major limiting factor of Jupyter -- at least for me! -- has been its lack of support for terminal emulation. This means it is incompatible with a lot of interesting TUI programs, so I just end up never using notebooks at all.
Having recently discovered Marimo, I've been really pleased to see how it fixes so many of my complaints about Jupyter (hidden state, git friendly, etc.). Is there any chance you could add to this list by also supporting terminal emulation?
Example use cases
For a couple of concrete use-cases, I'm a fan of both
ptpython
for opening embedded shells, andpudb
as a debugger that's better than the built-inpdb
. Both require that the output be a terminal emulator.Suggested solution
A quick google turns up XTerm.js. I've not used this / have no preference about implementation whatsoever. But as such my initial impression is that this might be a reasonable ask. (And not a large 'implement a terminal from scratch' kind of project!)