HN user

dakra

119 karma

https://github.com/dakra

Posts2
Comments25
View on HN

I have a fairly up to date Zig installed via Homebrew.

This is likely the problem. Latest Zig is 0.16 and Ghostty (and therefor Ghostel) require exactly Zig 15.2.

I just updated our code to have a better error message and make it clear that the problem is the Zig version. See https://github.com/dakra/ghostel/pull/541

jFYI, Ghostty issue to support 0.16 is here: https://github.com/ghostty-org/ghostty/issues/12228

So for your homebrew zig you probably have to:

brew uninstall zig

brew install zig@0.15

defined f1 to toggle between semi-char vs copy modes

this is useful anyway but just in case you didn't know, we automatically switch to copy-mode when it makes sense.

E.g. when you activate mark, click somewhere with the mouse or when point leaves the current prompt position.

That means that with isearch or consult-line etc you're automatically in copy-mode (because why else would you search something and then jump to that position).

For other commands like avy or flash jump packages I have this in the documentation:

;; A package that runs a hook after jumping (e.g. flash): (add-hook 'flash-after-jump-hook #'ghostel-maybe-leave-input)

;; A package without one (e.g. avy) — advise its jump action: (with-eval-after-load 'avy (advice-add 'avy-action-goto :after #'ghostel-maybe-leave-input))

Personally I use copy mode a lot but I rarely have to "manually" activate the mode.

True. I'll have to update the documentation with some examples (and/or make a video?).

I know you know them but I list the 5 modes quick here for readers:

- semi-char: The default, where most keys go to the terminal but some common Emacs prefixes (M-x, C-c) go to Emacs

- char-mode: ALL keys go to the terminal. This way you can run e.g. Emacs inside Emacs.

- copy-/emacs-mode: This makes the whole buffer a pure read-only Emacs buffer and all keys go to Emacs. The difference between copy and emacs-mode is that copy freezes the terminal output (comes originally from vterm), while in emacs-mode new output keeps coming in (adopted from eat).

- line-mode: It's like `M-x shell`, everything goes to Emacs but it's not read only but you can type text on the prompt. But nothing is send to the terminal until you press return.

why is nvim +term has only two modes, but this one has 5

I haven't used the neovim terminal, but I guess you can compare vim insert-mode with semi-char and normal-mode with copy-mode. And surely they have a char-mode as well, or can you not run nvim inside nvim (without having to press some quote key all the time)?

That would leave only line-mode as the odd one out.

But it's not super clear how in practice use that leverage efficently

As with all Emacs things, that's highly personal.

Currently, I use semi-char mostly and switch to copy-mode to select/copy stuff.

Very rarely do I use char or line-mode.

This is just optional.

I explained why it's not in the package in https://news.ycombinator.com/item?id=48881722

For all Emacs package updates, it's best of course to check the source what's changed and then you can compile yourself.

PS, I also think Emacs is one of the few ecosystems where people actually check what changed. It's not like npm where you have a million of deps unreviewed pulled in.

Personally I use borg and always at least quick check what changed, and most Emacs package managers have a similar feature.

You have the full power of Emacs to your disposal.

I have never used WezTerm but from a quick look, it seems you can quickly copy text ace-jump style.

In Emacs you could use e.g. avy to do the same, but there is probably a bunch of other similar packages that do the same.

And additionally you're not restricted to just select/copy a word. You can freely move around and use e.g. expand-region or similar to quickly select more.

It's Emacs after all, the possibilities are endless ;)

And not only mouse click of course, but you can use `ghostel-previous-hyperlink` (or ghostel-next-hyperlink) to quickly jump to the last hyperlink displayed.

It also installs a repeat-mode map, so if you see 3 url or file links as output you can just `C-c C-p p p RET` and it will open the first link.

I use that feature all the time.

Ah. I tested it before but now I see that I have `(setq eshell-scroll-to-bottom-on-input 'all)` in my config which always snapped point back to the prompt when I tried to edit the scrollback.

Anyway, unfortunately that is not possible in a Ghostel buffer and most likely also will never be. I'm open to ideas though how we could improve or replicate your eshell workflow.

But also, eshell is awesome and Ghostel is not a replacement for it. It's more a replacement for term.el, maybe shell.el (with line-mode) and other terminal packages like eat and vterm.

Did you see ghostel line-mode? This basically gives you a `M-x shell` experience where everything is a buffer and nothing is send to the terminal until you press enter.

There you could type on the prompt line and then call jinx or your quote wrapping function etc as it's just a normal Emacs buffer. You can't edit the scrollback buffer though, but I don't think that's possible in eshell either.

But line-mode has it's own set of problems. Since we don't send anything to the shell, you could have some problems with autocomplete or similar things that change the text depending on each typed char. Similarly we automatically disable line-mode when you enter a TUI (alt-screen) app, as line-mode doesn't make too much sense in e.g. vim. But that's configurable and you can still force line-mode, it really depends on the TUI apps.

We try to support as much as possible and work around things like fish autocomplete etc. But please try and report any issues you find.

That's because MELPA (and ELPA) doesn't have a way to attach platform specific files. It's all just git checkouts.

That means we would have to check in the module binary for all platforms (>10MB together) if we want that it comes with the distribution.

Also looking at e.g. jinx, another popular package that uses Emacs native modules, it does it like vterm and offers to compile on first usage.

So as a Emacs package author, for a user friendly installation you can realistically only offer to download or compile on first use.

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/#ghostel-vs-vterm

And here is a gist with images to compare performance and correctness: https://gist.github.com/dakra/4a0b76ebcf5d52338e134864378465...

But for me personally, it has not only replaced vterm/eat but also any other external terminal like kitty/Ghostty.

Having your terminal text just like a normal Emacs buffer opens up so many possibilities and extension points that are just not available on any other terminal.

Even simple stuff like searching in the scrollback, then navigating and selecting+copying a paragraph only with the keyboard. For every Emacs user that's so natural and fast in Ghostel while often cumbersome in other Terminals where I just reach to the mouse because it's easier.

Happy to answer any questions and also like to hear feedback positive or negative.

If you're an Emacs user and tried Ghostel and are still using Ghostty (or another external Terminal), is there something Ghostel is missing or is it just because you want some processes to run outside of Emacs?

baokaola and I are also very active on GitHub, so feel free to open an issue if you have any.

Just to expand a bit on "bunch of other things". You can see a vterm vs eat feature comparison here: https://dakra.github.io/ghostel/#ghostel-vs-vterm

Besides the performance and what baokaola already mentioned some things that make Ghostel better than vterm especially when working with those cli agents are:

- proper handling of resizing windows

- progress reports (you get a spinner in the modeline when claude thinks)

- notifications (get an alert when your agent is done)

- drag and drop works

- hyperlinks. urls and files are clickable

I really liked Bill Gates new Book: How to Avoid a Climate Disaster[1]. I liked that it shows what we have to do to get to 0 greenhouse gas emissions. What's the current state of technology and what's still left to do to get there.

I often find suggestions like "Meatless Monday" or "Only fly when really necessary" etc, while probably good, not really useful advice. In Gates book he talks about that transportation and "building things" is good and we should not stop it, but instead find a way to make it emission free.

[1] https://www.gatesnotes.com/Energy/My-new-climate-book-is-fin...

If you live in Emacs and interacting with it every day there is always something to tweak and it just grows organically. I don't think a big config file is an outlier. Not because it's necessary but simply because it's so much fun to scratch a small itch with a few lines of elisp which you couldn't do in other editors.

My config[0] for example is 10k lines with >1k commits.

[0] https://github.com/dakra/dmacs