tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
206 stars 11 forks source link

new tty proposal #64

Open progrium opened 5 months ago

progrium commented 5 months ago

We currently implement an oversimplified recreation of Linux PTYs, where you can make a "terminal" that starts a process and then STDIO is streamed altogether to be wired up directly to a terminal emulator. It's most obviously lacking the ability to resize a terminal, but we also don't implement much of the "line discipline" of PTYs. The latter is less important because specific line disciplines aren't used much any more other than switching into "raw" mode. But not being able to size/resize terminals causes terminal UIs to glitch and it gets in the way of using certain programs.

Unfortunately, terminal resize changes are communicated to processes via signals, which we don't have (tracked by #78). The current plan is to implement our own GOOS runtime that implements our own os/signal so we can at least signal programs compiled with our compiler with GOOS=wanix. This should give us other benefits as well, but seems like a reasonable solution to terminal resizing. Our tty system will have to be updated to support this.

We will still not have real Linux PTYs, but I'm not in dire need of them. In fact, I'd rather model our tty system after the Plan 9 console system, which is similar but different. Simpler if I recall.

Since we have #78, this issue will track implementing a full PTY/console system based on Plan 9.

taramk commented 4 months ago

blocks #69

taramk commented 3 months ago

there are issues with the terminal that cause micro to not be able to rerender lines as you're working, and in the shell the last character that you've typed sometimes get occluded by the cursor (check if this is rare or not)

progrium commented 3 months ago

I've updated the description of this issue to explain the problem and a plan to emulate Plan 9. It's now de-prioritized.