Live data from Hacker News

Ghostel.el: Terminal emulator powered by libghostty

dakra.github.io

21–30 of 74 posts

Re: Ghostel.el: Terminal emulator powered by libghostty

#21
post #15
post #14

Question: if I don't use TUIs or millions of lines of scrolling text, what am I missing by not using these newer terminal implementations? I use mintty on Windows and am pretty happy with it.

Honestly not sure. I used ghosty and others for awhile but had continuous issues of it not passing a compatible term variable so a lot of tuis would break.

This is normally a problem only when connecting to a remote computer through ssh, if you have not installed there the terminfo entry for ghossty or kitty or whatever recent video terminal emulator you are using.

If you do not want to or you cannot install the terminfo data, there is the easy workaround to put in your shell initialization script on the remote computer something like "export TERM=xterm-256color".

Ghostty aims to be completely compatible with xterm, so everything should work fine after setting thus TERM, only the newer features of ghostty will not be available.

Re: Ghostel.el: Terminal emulator powered by libghostty

#22
post #7

Hi! Maintainer of Ghostel here. baokaola and I actually wanted to do a "Show HN" next week, but looks like someone was faster submitting the link. Have a look at the GitHub repo which is a bit nicer for a quick overview: https://github.com/dakra/ghostel To add some context, Ghostel is a terminal emulator for Emacs powered by libghostty-vt. There's a feature comparison vs vterm and eat: https://dakra.github.io/ghostel…

How was integration for you guys? Was the integration easier for you guys since you have an established emacs system consuming terminal output with reasoned semantics over what goes where for existing subsystems (rendering, osc codes, etc)? For libghostty-vt, since you're targeting a terminal TUI instead of an external subsystem (for example; for ghostty, you hit libghostty-vt -> GPU rendering, which is external), yo…

I'm not entirely sure what you're asking. But I'll answer to the best of my abilities:

For Ghostel, libghostty-vt is the source of truth and the architecture is essentially that we serve input to the PTY and the PTY serves output to libghostty-vt which builds out the state in the form of a terminal screen structure. The goal is then to keep the contents of an Emacs buffer up to date to this terminal screen without replace the entire thing every time we redraw. We make use of mainly two things in order to do as little work as possible: - Scrollback is immutable and thus never has to be modified unless it's evicted, alt screen is activated, dimensions change etc. - libghostty-vt maintains row level dirty flags that we scan to make sure we're only replacing lines that have actually changed.

So for the rendering part, we're only diffing the grid state against the buffer, not doing anything based on terminal semantics per se, parser events that draw to the screen are passed straight to the terminal handler. But of course, certain things we need to hook into such as directory and title changes, of clipboard events etc.

Might also add that we're using the direct Zig API, not the C API, which means we have access to things that aren't exposed in the C API.

Re: Ghostel.el: Terminal emulator powered by libghostty

#25

Ghostty has crashed nightly for me with ~10 terminals open across a few windows. So, I haven't been able to run it nor would I want to embed it inside anything I daily drive.

cool story bro. feel free to make a github issue. I've been daily-driving Ghostty for years and i don't remember the last time it crashed on me.

Re: Ghostel.el: Terminal emulator powered by libghostty

#26

Ghostty has crashed nightly for me with ~10 terminals open across a few windows. So, I haven't been able to run it nor would I want to embed it inside anything I daily drive.

I am running Ghostty 1.1.3, on Gentoo Linux.

I have opened right now about a dozen Ghostty windows and about 20 tabs in each window, i.e. more than 100 shell instances.

I have started in as many of them as I could, before becoming too bored, a "ls -lR" on a file system with many millions of files.

I could not see any problem, much less any crash. I have been using Ghostty for a few months, very intensively, all day long, and I have not seen any crash or other suspicious behavior.

If you have seen a crash, perhaps there was either some specific version of Ghosstty that had a bug, or, more likely, some weird interaction with some other software that you have, and which might be buggy, e.g. the GPU driver. (I am using an NVIDIA GPU.)

Re: Ghostel.el: Terminal emulator powered by libghostty

#28
post #7

Hi! Maintainer of Ghostel here. baokaola and I actually wanted to do a "Show HN" next week, but looks like someone was faster submitting the link. Have a look at the GitHub repo which is a bit nicer for a quick overview: https://github.com/dakra/ghostel To add some context, Ghostel is a terminal emulator for Emacs powered by libghostty-vt. There's a feature comparison vs vterm and eat: https://dakra.github.io/ghostel…

Howdy,

Awesome project. Been using with doom for a while. How do you manage to get scrolling programs to work (eg Lazygit or Reasonix) where other emulators fail? Is it something special in your implentation or library that makes this work?

Re: Ghostel.el: Terminal emulator powered by libghostty

#29
post #5
post #3

I recently switched from vterm to ghostel, and it is generally much, much better - noticeably faster (e.g. fancy TUI apps that try to refresh the whole terminal every frame actually work), more reliable input handling, and a nicer ELisp API. That being said, there are still some rough edges. Sometimes it fails to properly clear the terminal, leaving junk at the top of the buffer before the currrent prompt line. And o…

Ghostel co-maintainer here: Understand if you don't have a repro, but if you ever have something actionable we'd love it if you filed an issue, or have the information get to us some other way. The junk at the top of the screen sounds like it could be https://github.com/dakra/ghostel/issues/495 and it should be fixed on later versions. But maybe you're seeing another bug. The tricky part is replicating the libghostty…

> The junk at the top of the screen sounds like it could be https://github.com/dakra/ghostel/issues/495 and it should be fixed on later versions

Yes, that sounds like the same issue. I’ll update to the latest version and see if it’s resolved. And thanks for your work on this package, it’s been a real game-changer for me!

Re: Ghostel.el: Terminal emulator powered by libghostty

#30

Ghostty has crashed nightly for me with ~10 terminals open across a few windows. So, I haven't been able to run it nor would I want to embed it inside anything I daily drive.

I am running Ghostty 1.1.3, on Gentoo Linux. I have opened right now about a dozen Ghostty windows and about 20 tabs in each window, i.e. more than 100 shell instances. I have started in as many of them as I could, before becoming too bored, a "ls -lR" on a file system with many millions of files. I could not see any problem, much less any crash. I have been using Ghostty for a few months, very intensively, all day l…

Just commenting to say I've had the same experience. Been using Ghostty since (I was aware of) its release and it has been buttery smooth ever since. I occasionally see people talking about crashing or other issues they've had with Ghostty but I've not seen anything of the sort.
Post reply on HN