Also I just tried Ghostty for the first time. With iTerm2 and the Zsh/Powerlevel10k theme, there's an extremely brief but perceptible lag from running a command and the render. In ghostty it feels actually instant.
@mitchellh That's super exciting. I'm wondering how easy it would be to integrate in the debugger frontend I'm working on. Do you already know what the C API will look like?
Maybe this concern doesn't apply to libghostty, as I think search would be more of a UI concern.
It's one of a few "lost capabilities" of AmigaOS I'm glad to see getting addressed. You can of course fix this today by using one of a variety of terminal widgets, but the ease of being able to just spin up a full terminal window from "anywhere" was very powerful for simple utilities etc.
Tmux copy mode is already great, my one gripe is no line numbers.
This script https://gist.github.com/Nimmidev/2cf4d5cc80dce32d0240ec7b3cf... is pretty good, but I still get frequent bugs with it, and also it just doesn't work in fullscreen mode (2 panes).
The core issue is that it's allocating a new tmux pane with the sole goal of mirroring line numbers; it would be nice if they synced up in the same pane, avoiding the above issue.
Piping it into neovim is an option that you can do on both neovim and zellij. zellij loses colors, and neovim is probably the best solution to this problem but then again I don't want to have to remember to turn on/off line numbers every time and I personally like one-off panes. Separation of responsibilities, I guess.
Long-winded rant to basically say: would a standard like this solve my issue easier? From what I understand of terminals, I would need to parse the underlying pty, maintain a scrollback buffer internally in the wrapper shim, and also be able to dynamically adjust toggling line numbers on/off.
If I'm doing this kind of translation, how "leaky" will the abstraction be until I'm basically re-implementing the logic in my middle layer, assuming that "for free" I can get the translation both in and out from the pty?
I've been trying to look closer at TUI tools, but that's what really bothered me. Given just how god awful the VT protocol is, you could get the state machine parsing correct, but the developer still has to learn basically every little quirk that was added over the years, no?
(And before someone makes a false equivalence, no, this isn't the case even with languages like c++ - I'm still learning quirks about it to this day, but I don't have to learn the entire thing to build proper, robust code. It does not seem the same with something like the VT protocol. So yes, I'm aware that some learning should take place, but I'm wondering how structured of a developer experience this will end up being.)
Curiously, it hasn't been discussed on HN before, so I started a thread to get HNers' thoughts on it:
If I could "just" use libghostty, that would be great!
The nix package for ghostty is broken/unavailable on MacOS at the moment, but installing the brew cask (`brew install --cask ghostty`) and a basic config file:
```
font-family = Monaco
theme = dark:Catppuccin Frappe,light:Catppuccin Latte
```
Got me almost everything I used from iTerm2. Nerdfont just worked (in iTerm I think you have to use the `Use a different font for non-ASCII text` setting)
Aside: I didn't realize Ghostty was written in Zig, wow. The first Zig-thing I'm aware of using on a regular basis. It's amusing the repository structure looks exactly like a Golang layout, haha.
I never thought in a million years I would even think of ditching iTerm2 but when Ghostty dropped I installed it and fell in love.
- Still no ⌘F for find.
- No way (that I know of) to select previous output or specific string and copy with only keyboard shortcuts.
- No ⌘. sending CTRL-C (muscle memory and being advertised as native to the Mac is what one would expect).
- Fonts still don't render as nicely as in Terminal.app. I've fiddled with `font-thicken-strength` and it's close, but not quite. Probably impossible or very hard to replicate due to its Metal rendering nature, but when all you do is look at text all day, it matters.
Gruvbox light theme looks great too.
The fact it's written in Zig is awesome too, if you ever question if Zig is ready, ghostty is your answer to that.
Not seeing myself going back. It's great experience.
Tip: if you combine your ghostty flow with aerospace, it's nearly perfect setup for your keyboard only experience on mac.
I think there is space for an Electron-like framework but for standalone terminal apps. Looking forward to using Ghostty as a library.
Ghostty is really good and I genuinely appreciate this.
Honestly, Might seem like a small thing but the fact that this doesn't even depend on libc seems to be a really great thing to me and I kinda cherish it!
Thanks! Have a nice day!
I've looked into it with a PiZero and some HATs but I'd like something made by smarter people. This would be perfect for that.
Ideally just some dip-switchs to set the terminal to emulate and set the display resolution.
Oh oh oh!!!
> https://github.com/ghostty-org/ghostty/issues/1935
awww...
(while ghostty can parse Tmux Control Mode stuff, it doesn't actually implement the full feature. My dependence on iTerm2 remains...)
He has side projects that would make careers for most of us.
The function signature of [1] ...
ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t,
ghostty_input_mods_e);
(^^^ probably not readable in small screens)... is the perfect example of why "align continuation lines to the open bracket" is the absolute worse option versus the simpler, consistent and only logical choice of "align continuation lines with an extra indentation", aka
AlignAfterOpenBracket: DontAlign
in Clang-Format [2].[1]: https://github.com/ghostty-org/ghostty/blob/f97518cc10059918...
[2]: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#ali...
I walked away thinking that no matter what they did, they'd probably be successful. I was extremely happy to find Ghostty and have been using it ever since.
For what it's worth, that shortcut also doesn't work in the Jetbrains terminal, Alacritty, Kitty, and even iTerm2. The only terminal emulator I've tried so far where that works is the built-in Terminal.app.
Despite these shortcomings I still use it daily since the first time I tried it, and have come to really love the project in general. I often won't hop to new software if it offers friction like this, but Ghostty pulled me in despite some snags.
Zed is also wonderful software, though it took me way longer to commit to using it daily.
Also, not sure if this is by default or it picked it up from my old iTerm2 configuration, but cmd+shift+up/down navigates through prompt lines so it's easy to find the start of a long command. My PS1 in zsh is:
PS1='%1~ %F{green}»%f '
Also I just went from a somewhat (niche?) languages rabbit hole and I refound crystal / crystal is in my mind currently..
So what are your thoughts on using something like crystal instead of ruby because they are similar in what I know and crystal can create a static binary while being (faster?) than ruby
I am just somewhat curious to know!
> The terminal seems simple at first (you type in commands and run them! no big deal!), but the more you learn, the more you notice a million little inconsistencies (why does pressing the arrow keys sometimes print out "^[[D"? why does selecting text sometimes not work? why are the colours sometimes unreadable?) that make it feel like an inscrutable black box. And it often doesn’t feel worth it to learn more because documentation about the terminal is so fragmented and full of obscure jargon.
> But! Understanding just a little more about the terminal can make your experience WAY better. You can quickly recognize what’s causing a problem (“oh, my arrow keys aren’t working because this is one of those annoying REPLs that doesn’t support arrow keys!”) and immediately fix it (“I’ll use rlwrap!). Or you can turn “wow, this text is unreadable” into “oh, my terminal emulator is responsible for colours! I’ll just go into the settings and reconfigure my colours!”.
This library would be for the task of taking a received ECMA-48 character stream and turning that into a series of actions on some sort of model of a terminal's display, keyboard, and mouse.
You are looking at a library for the (roughly) inverse task of taking a model of UI widgets and turning that into a transmitted ECMA-48 character stream.
Here's an example of the former:
* https://github.com/jdebp/nosh/blob/trunk/source/ECMA48Decode...
* https://github.com/jdebp/nosh/blob/trunk/source/SoftTerm.h
Here's an example of the latter:
* https://github.com/jdebp/nosh/blob/trunk/source/ECMA48Output...
* https://github.com/jdebp/nosh/blob/trunk/source/TUIDisplayCo...
* https://github.com/jdebp/nosh/blob/trunk/source/TUIVIO.h
* https://github.com/jdebp/nosh/blob/trunk/source/TUIVIOWidget...
People should really measure coding proficiency as being 10% of these guys or some fraction instead of whatever metric they are using now (slightly kidding ofc)
They are the 10x developers and I feel like this sentiment is echoed all across the industry
There's an old Knuth quote:
> In fact what I would like to see is thousands of computer scientists let loose to do whatever they want. That's what really advances the field.
And I think we're seeing more and more that these projects made with love are successful. That without the hyper fixation on money we can build good projects that make big changes in a world.In some sense I'm a bit envious of Mitchell but truthfully these types of things make me more question how we've constructed our society and economy. It shouldn't require one to start with wealth to be able to build things that have such an impact. What needs to be changed where we can live up to what Knuth proclaimed. I'm sure all of us have had experiences where were we given the time (and usually not much) we could make things so much better. But we make many sacrifices when we rush. Which leads to more good advice by Knuth
> If you optimize everything, you will always be unhappy.
At what point do we push back? We see that the people we really look up to did things so differently. Knuth himself expressed how detail obsessed he was, and such a claim is common among the grey breads.
Of course, things change, but are we creating a world with no wizards? Are we creating a world where we reward people for solving problems and making our lives easier? Or are we just maximizing some score of a pointless game?I'd love to live in a world with a thousand more Mitchells, following their passions without the burden of needing to justify decisions to a board who has no interest in quality. How do we create that world?
Like you said, what a legend. But, how do we make more legends?
However their financials are... LOL
Revenue US$583 million (2024)
Operating income US$−254 million (2024)
50% loss margin :-)))
This comment sounded familiar[0]. :) For what it's worth, still possible with:
keybind = "cmd+.=text:\x03"
[0]: https://news.ycombinator.com/item?id=42889411- It doesn’t respect the user’s configured fonts. - Clipboard support is inconsistent. - The GTK4 UI is quirky, and has silly slow animations in situations which don’t make sense.
The first two sound like more serious issues, and I’m surprised that others haven’t found them dealbreakers.
Mitchell raised the issue himself two years ago: https://github.com/ghostty-org/ghostty/issues/189
Finding mechanistic (& programmatic) sympathy counts for so so much! Shapes the arch of software so much! But it's such invisible unknown work to most people, not so overtly clear & obvious but something that constantly builds day after day, person after person, incremental 0.2% gains compounded by lack of friction.
As well as just promoting good practioners, it feels like discourse about software architecture has really fallen off. We are deep inside rabbit holes specific to this framework or that, and there's only occasional popping out to free air to bring back some observations from the burrows. Ideally we'd have many more volumes of Architecture of Open Source Applications (2011), for example, to really dive into what is, to give us some common referents to learn from and talk about. https://aosabook.org/en/
This is all so core, so worth getting deep on & looking how things are assembled, what the interfaces and modules and shapes look like, what the tradeoffs were. But it remains chiefly an arcane art, one that most developers much less most businesses haven't developed a refinement or taste for.
I also like that I can have my config in a little plaintext file and just drop it onto a new computer and get the same keybindings. I am using the terminator keybindings for creating and navigating between split panes.
But having only used ghostty as-is and getting bamboozled by the copy paste situation, this is game changing. I was just going to wait till preferences had a GUI/TUI.. So thanks!
It’s native in the sense that it’s not Electron, or Java, but it’s still a layer of abstraction which introduces all sorts of quirks.
but really not all features can make it in 1.0
My router doesn't have a video port, but it does have a dummy terminal port. I had to scrounge a video card for my server to set it up, but it does have a serial port [3]. So that would have been nice.
Also would be nice for a modern remake of dumb terminal with abandoned monitors.
[1] https://www.cabling-design.com/references/pinouts/EIA-TIA-56...
https://gist.github.com/VinceGuidry/b44f02117d452bde7471dae2...
I like crystal but without pure OO and the fact that the community is so far behind Go or even Scala it's hard for me to see a good use for it.
You can create static binaries with ruby, just use mruby. I had a bunch of small scripts in crystal that I replaced with mruby and never noticed the difference. You don't get runtime reflection or ruby's enormous library base, but it could fill the need. I may end up transcribing my editor, or perhaps just the parser, to mruby once it's ready.
https://mruby.org/docs/articles/executing-ruby-code-with-mru...
For a fully-static binary, the option you want is at the bottom,
Example: Neovim is considering the switch to libghostty-vt when its ready. https://github.com/neovim/neovim/issues/33155
Anyway, I hope it doesn't get lost that this comment was only meant to be half informative, half public statement, and half a light joke :)
One thing I've been envisioning is something like a "certified B corporation" style qualification that companies can get that indicates they contribute financially back to open source commensurate to the amount of it they consume to run their core business. If everything you do runs through open source software, in a moral sense, one can make the argument that you owe something back to it.
Actually, that's the question (or rather the feeling) I had even before seeing these numbers. Just by reading the docs and looking at everything they built (and how they built it) made me wonder if they spend more than they make. That's a really funny feeling I never had before. Like, surely economies can't be that forgiving when it comes to polishing things. Is that what's happening to the company? Mere overspending?
I've been delaying a major migration to NeoVim on [modern-terminal-I-can-never-decide-which] for years. Wezterm, Ghostty, iTerm2. None is exactly perfect, so I just keep watching them develop.
Wait wait wait, this is a shortcut in Mac??
I tried a while back to invert my workflow (from tmux driving neovim to neovim driving terminals) because I thought it might be easier to only ever have one buffer open for a given file, instead of attempting to open a file in a given pane only to realize that it's already open in a different neovim instance in a different pane.
When I was testing that stuff out I don't think I noticed particular issues with text reflow that would benefit from being solved by swapping to libghostty, rather my pain points were just about how to adjust to the different paradigm. I'd be curious to hear more about someone who is all in on Neovim embedded terminals (and possibly how libghostty might make it better).
[1]: https://github.com/charmbracelet/bubbletea?tab=readme-ov-fil...
If you don't know, you can send the log to a file, and open that file to look through it. More powerful than just a search next, as you can have instance counts, search with regexp and all the bells and whistles and it virtually stops the logging.
At first I thought the same as you, now I've become quite partial to this concept. I hope they don't remove this.
Pop the whole scrollback in helix, where I can search, select, jump around, paste stuff into a scratch buffer. It’s slick. It’s got a normal search too. But yeah I haven’t used a built in emulator search in a while I guess!
Plus, they're very open about what they're doing and prioritizing. As another commenter said, it's coming soon. For the rest, open feature requests, you might have needs that others didn't think of or even realize they needed
But the same general problem exists in industry. Our fear of doing things non-optimally only results in a less optimal solution. It's a risky move to take no risks.
In both academia and industry you see the same people doing the same things in the same way. It's no wonder things don't change. You can't have a paradigm shift by following the paradigm (playing it safe). I feel like this is a big shame in both tech and academia as the histories of these have always been made by those who rocked the boat. At some point we just have to admit we're not very good at predicting the future and instead of trying to predict what will be the most successful we should fund passion. I'm sure charlatans will get funded too, but its not like we're doing a good job at preventing that from happening now anyways...
I live in vim and after about 30 seconds of checking ghostty out I switched from iTerm2 to ghostty for good. No regerts.
I also used Terminal until recently and don't use any of the advanced features alternatives provide. The main reason to switch from Terminal.app is truecolor support. The terminfo thing is annoying but I just setenv TERM in ssh config. Better split panes is nice. Configuration in a text file is a matter of taste, but documentation is good.
Also not sure how ghostty would help, haven't noticed text reflowing issues.
It's not bad, a little awkward getting used to:
- you might want a plugin to give you a "persistent" terminal across all tabs
- I still haven't found a way to clear scroll back while a command is running
- I had to set up mappings for easier exiting terminal mode (c-\ c-n really sucks)
- I had to set up events so whenever a terminal buffer is focused it immediately enters insert mode. While I love vim, I've never wanted modal editing in a terminal
> I thought it might be easier to only ever have one buffer open for a given file, instead of attempting to open a file in a given pane only to realize that it's already open in a different neovim instance
This is not a problem in my config:
vim.api.nvim_create_autocmd({ 'FocusGained', 'BufEnter', 'CursorHold' }, {
pattern = '\*',
command = 'silent! checktime',
})
Since `'autoread'` is by default `on` in Neovim, this seamlessly reloads the buffer if the underlying file has been updated on disk.Sqlite team also seems to be one of the 100x people imo. Maybe I just cherish sqlite's simplicity and its hyperfocus and it delievers exactly what it says (somewhat), a lot!
Definitely feel like we need a forum where we can all compile a list of 100x developers and vote who is the best 100x developer
I feel like although Mitchell is up in the top three. To me bellard/torvalds tops it all of if you consider it from a pure software perspective and not that Mitchell went back from a billion $ empire to hacking again
Bellard has created qemu and ffmpeg and tcc/jslinux/ I think even xterm js kind of came somehow due to bellard so a lot of terminal emulators and their recent work is just as fascinating.
Torvalds with linux and git are two back to back things which we know and love and use today.
Bellard is just a little less known because unlike linus torvalds who named the os as linux ie. after himself. Ffmpeg and qemu don't really tell them that they are created by the same guy.
Micro is a truly goated software. I mean, it can genuinely replace vscode for small scale editing in the context of shopify that the parent comment was referring to.
https://micro-editor.github.io/
It also helped me in physics when I had to remember the units like 10^-6 being micro, 10^-9 being nano etc. and the funny thing is that I used to remember it in the start by seeing I am not sure if it was on micro's github or something but it was a comment on how micro has more features than nano and thus it's name.
So like for some time I definitely felt like I was thinking of micro software, then nano and making the feature comparison to find micro to be larger than nano.
Might seem kinda niche but I ABSOLUTELY LOVE MICRO. Its the one software that I install everywhere, even on my android phone by using UserLand[1] with alpine linux.
I tried writing python code on my phone and it was definitely pleasant thanks to micro.
The previous commentor is hoping he'll move on because maintaining isn't as fun as starting? Why do you think he can't decide that for himself?
"How much content is in this window"
and
"Where am I in that content"
I still use it daily but it means I have to switch tools for certain things, and reading log files or log output is one of the more common reasons I switch.
I should probably look into trying to get the scrollback info into my statusline, No idea how easy or hard that is - so if someone has done it, feel free to shoot me pointers.
" Load vim configs
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrcThen in my zshrc (well... I organize differently) I have the function
function _exists() {
command -v "$1" &> /dev/null
}
alias_vim() {
if (_exists nvim)
then
alias vi='nvim'
alias vim='nvim'
elif (_exists vim)
then
alias vi='vim'
fi
}
In foot I just ctrl+shift+r and search back the references one-by-one in a mode, which I guess is 90% of my use case for scrollback.
I always was on the camp of "tail -f file.log" but since discovering this app, I saw the light.
(( $+commands[vim] )) && alias vi=vim
(( $+commands[nvim] )) && alias vi{,m}=nvim
I was thinking more of in terms of performance for some similar developer experience
Pardon me but isn't crystal OOP? i feel like it was because I was introduced to crystal lang via some youtuber some long time ago and the comments said that they didn't use because it was OOP
Also if mruby is so great (which it sounds here), then surely most ruby contributers can migrate over to mruby if that has these gains. I think mruby compiles to C as the intermediate right? So there are definitely some limitations as compared to being a interpreted langauge but that can be somewhat mitigated, no?
I am not a ruby expert or a crystal expert. Because If I was, I would be telling you your future (a slight pun ofc of being a future teller but yes I don't know much about it except the puts syntax or that 100 seconds video from fireship which gives me 10 year experience in ruby :p )
Yours isn't technically equivalent though it is functionally. If we have both vim and nvim then we'll alias vi twice.
Also, your program provides less clarity. It saves lines but at a large cost to readability. I tend to share my dotfiles with newbies a lot so readability is very meaningful.
I wrap mine up in functions too because at the end of my alias file I can add something like this
# aliases.zsh
main() {
alias_ls || echo "ls aliasing failed"
alias_vim || echo "vim aliasing vailed"
}
main
It's a bit overkill and I never expect a simple alias like that to fail but there are three distinct advantages I get for being just a tad more verbose:1) I have more complicated versions to deal with things like fd and batcat which have different names different operating systems (`fd` vs `fd-find` / `bat` vs `batcat`) and some additional configurations.
2) I can disable the alias by commenting out one line
3) knowing exactly where the alias is being loaded and thus what aliases are loaded.
Bonus) fails loudly but continues (it's an alias, I don't want you fail fail)
A few extra keystrokes are worth this advantage imo. Especially since I'm using vim so it's actually not any additional typing lol
It's style, so the choice is up to you and they'll accomplish the same things, but I'm just explaining why I use this design pattern. I've only given a stripped down snippet of code so I hope this context helps explain the larger pictures and how it can be used for larger needs.
Over two years ago, in one of my first public talks about Ghostty, I shared my vision for libghostty
: an embeddable library for any application to embed their own fully functional, modern, and fast terminal emulator. Libghostty is finally starting to take shape, and I'm excited to share more details about my plans for it.
The first libghostty library will be libghostty-vt
: a zero-dependency library that provides an API for parsing terminal sequences and maintaining terminal state, extracted directly from Ghostty's real-world proven core. It doesn't even require libc!
Disclaimer: This post is predominantly a roadmap update for libghostty and announcing what will be the first shippable component of it. The Zig API is available for testing now, but the C API is not ready and will be coming very shortly. In both cases, it is early testing quality and not ready for general usage.
Let's start with some background on why I believe libghostty must exist.
There are hundreds of programs that implement some form of terminal emulation. The most obvious are the actual general purpose terminal emulators like Ghostty, Kitty, iTerm2, etc. But terminal multiplexers like tmux or zellij are also full terminal emulators Editors embed their own terminal emulators too, such as jediterm for JetBrains products, Xterm.js for VS Code, or Alacritty in Zed.
In addition to fully functional terminal emulators, many websites and applications implement read-only terminal emulation to display logs or command output. For example, GitHub Actions output parses simple color sequences (but not much else). And hosting providers like Vercel or Render implement a simple form of terminal emulation allowing line clearing and redrawing within build logs as well as parsing colors.
Many of these implementations are ad-hoc, one-off solutions. They aren't using any shared library or codebase.2 Terminal emulation is a classic problem that appears simple on the surface but is riddled with unexpected complexities and edge cases.3 As a result, most of these implementations are incomplete, buggy, and slow.4
Beyond correctness, implementing any form of terminal emulation is a waste of time for most developers. Terminal emulation is not the core business of JetBrains, Visual Studio Code, GitHub, Vercel, Render, etc. It'd benefit them if they could have a stable, reusable solution that's consistent everywhere.
My answer to this is libghostty: a cross-platform, minimal dependency library that exposes a C API so feature-rich, correct, and fast terminal functionality can be embedded by any application anywhere.
libghostty-vt
The first libghostty library will be libghostty-vt
: a zero-dependency (not even libc) library that provides an API for parsing terminal sequences and maintaining terminal state such as cursor position, current styles, text wrapping, and more.
Parsing terminal sequences is the most core functionality of a terminal emulator, and is required by full terminal emulators like Ghostty down to simple read-only style-only views such as GitHub Actions or Vercel build output.
The state diagram might appear relatively simple at first glance, but an implementation is unexpectedly challenging to get right. For example, Jediterm doesn't handle intermediates correctly, causing the widely supported "change cursor shape" sequence to swallow a character in every JetBrains editor at the time of this post.
For style-only parsing, many developers skip the full state diagram. Instead, they do some light web searching, parse simple ANSI sequences such as \e[31
or \e[41m
, and claim "color support." But style-only sequences are vastly more complex than that, for example they support RGB which itself can be in a dozen formats. And I still haven't found a single web console that renders this complex style sequence correctly.5
libghostty-vt
aims to fix all of this.
libghostty-vt
is extracted from Ghostty and inherits all of the real world benefits: SIMD-optimized parsing, very good Unicode support, highly optimized memory usage, a robust fuzzed and Valgrind-tested codebase, excellent feature compatibility such as parsing Kitty Graphics Protocol or Tmux Control Mode, and more.
All of this is packaged up into a single zero-dependency C API (it doesn't even rely on libc), allowing it to be easily embedded into any popular language ecosystem.
Given the minimal footprint, libghostty-vt
will be widely portable. Initial targets will be macOS and Linux for both x86_64
and aarch64
architectures, since those are the primary targets for Ghostty the application. But I plan to expand support to additional targets such as Windows, embedded devices, and the web via WASM. libghostty
will have broader support than Ghostty the GUI, due to its tighter scope.
libghostty-vt
is just the beginning. Longer term, we will provide more libghostty-<x>
libs that expose additional functionality such as input handling (keyboard encoding is a big one), GPU rendering (provide us with an OpenGL or Metal surface and we'll take care of the rest), GTK widgets and Swift frameworks that handle the entire terminal view, and more.
As fundamental pieces stabilize, we will continue to offer more and more functionality. These will be structured as a family of libraries to minimize dependency requirements, code size, and overall maintenance complexity.
libghostty-vt
StatusI just merged the pull request exposing libghostty-vt
as a Zig module. This PR includes a minimal example program, too. If you're a Zig developer, you can start experimenting with libghostty-vt
immediately.
The C API isn't ready yet, but it is what I'm working on right now and it'll be available for testing soon. All of the work required is defining the C API, since the core logic is of course all there and has been used by Ghostty for years. Plus, the Ghostty macOS app already consumes an internal-only C API.
If you look at the internal-only C header, please ignore the mess. It isn't a good C API. It is internal-only and exists to satisfy the needs of the macOS application. This isn't a generally consumable libghostty, although it is used by real commercial products already to embed Ghostty. We'll take a clean slate approach defining the C API for wider usage.
I plan to version libghostty
separately from Ghostty the application. This blog post marks the public alpha (not promising API stability) and I'm hoping to motivate some developers to come use it and eventually write some language bindings once the C API is ready.
I hope to ship a tagged version of libghostty-vt
within the next 6 months, but it'll all depend on if its ready or not.
We're at the critical stage of libghostty where we're designing the API, and the best way to design an API is with feedback from real consumers. Ghostty is one consumer, we have some community members working on other libghostty-consuming projects, but we could use as many as we can get!
If you see a use case in your projects or organization for libghostty, please join the Ghostty Discord and collaborate with the developers working on this. If you don't want to join Discord, email me (email in the footer of this website).
The state of libghostty
at this stage could be considered alpha, so don't expect a polished, stable experience. We're looking for hackers that want to get on the ground early.
The "alpha" quality is with respect to the API (functions and types) itself. The core logic is shared with Ghostty and is extremely stable and proven in the real world.
I'm super excited that Ghostty the application has finally reached the stability where we can start moving towards the libghostty
goal. libghostty
is the next frontier for Ghostty and I think it has the ability to make a far larger impact than Ghostty can as a standalone application itself.
Don't worry, there's plenty of changes for Ghostty the application and none of this diminishes my excitement or plans for that. Wider usage of libghostty
will result in a more feature rich and stable Ghostty application, too, since Ghostty itself is a consumer of libghostty
.
Boo. 👻
These own the pty to their children, parse all the escape codes, manage screen state, and ultimately "render" by emitting their own escape codes to a parent terminal emulator. ↩
Many websites do use Xterm.js and the GTK ecosystem has libvte. But this only covers a tiny fraction of the landscape and each of the aforementioned examples are limited in their own scope. ↩
I've spent the better part of 3 years working on terminal emulation and we're still finding weird edge cases. ↩
Here are a couple real examples of impactful issues: Jediterm didn't handle intermediates properly, Apple's Terminal.app just bleeds DCS sequences into the output. I'm not calling anyone out specifically, just showing that these issues exist and terminal emulation is very hard to get right. ↩
A lot of general terminal emulators also got this wrong, including Ghostty just 9 months ago. ↩
With a pure object system everything is accessible by the system at runtime. It's ruby's biggest strength, but also the superpowers it grants aren't always used for good, which is why a lot of coders hate working in it. I only code for myself, my coding career is behind me, so I don't have to worry about other people's code.
Mruby's big downside is precisely that it's compiled, so the library base available is very small, and there's not much point in building on it, though a few projects have, such as DragonRuby. It also doesn't have a pure object system. Ruby has thousands of gems, mruby dozens, and you can see them all on this page: https://mruby.org/libraries/
Static typing is also available in ruby but I understand it's clunky.
- Session management. I've written custom scripts for myself around this (zoxide + fzf). If you want to see how this can be used, look at ThePrimagen's workflow. I don't use his scripts but he has a good demo of how he harnesses sessions.
- Unified scrollback management - easily search the scrollback, yank it, etc. My favorite thing to do is to yank part of the scrollback, then `Prefix+B,=` to list everything I've yanked (think of this like a "clipboard manager" specific to tmux), select an entry, and press `e` to edit it in `$EDITOR`.
- This one might be a stretch, but I tend to try and use only terminal tools (without being utterly insane) because then tmux can be my "tiling window manager" no matter what OS I'm on. Oh, I have to use Windows for work? Not to worry, tmux runs in WSL2, as do most of my preferred tools, so I feel mostly at home even though I normally really dislike Windows.
- It's scriptable. Read `man tmux` and use your imagination!
Notwithstanding any of that, there are cons, the most apparent one being that I am limited to text-based tools this way. An example of this: getting images to work in tmux, though many modern terminal emulators support them, is a huge pane, so I haven't bothered.
$ cat foo.log | less
$ cat foo.log | $PAGER
$ cat foo.log | grep 09-23-2025 | less
Side note / pro tip: on a new line in the terminal press control-x control-e. If you're in zsh you need to edit your config but this will work out of the box for bash.My terminal history is normally huge, and the log output would be some unknown percentage of the total scrollable history.
Mostly terminology is just a fairly good terminal, so I have little incentive to switch. :)
https://www.reddit.com/r/tmux/comments/1ch9tqp/primeagen_tmu...
$ rm -rfv huge_dir
(A zillion removed files scroll past)
Now check if any of the removed files that were dumped out contain “foo.txt”.No, “just run it again” doesn’t work.
Or do you mean when you inevitably forget? Well then yeah you're at the mercy of your terminal but as others mentioned ghostty has a hack to help as well as some other terminals. But this should also help reinforce why you should pipe more often and write to files (or tee). It sucks but not making the same mistakes in the future and learning better habits will help you write better code and use better practices.
But that's the age old problem of "you can't analyze the data you didn't record" and that's a footgun you'll experience in every programming language, every experiment, and across many parts of life. Better to record and throw it away than not record and regret it.
It IS recorded. It's right there in scrollback (Literally the default buffer to record). It's easily accessible with most tooling, including nice scrolling, mouse support, find/search, etc...
Except in Ghostty, it's not so accessible. No find, no scrollbars.
I end up having to dump it into another tool, which at least they make pretty easy (ex: https://ghostty.org/docs/config/keybind/reference#write_scro...).
Although deciding when to do that would be easier if I had a better indicator for just how much scrollback content exists. Ex - if it's 3 pages... I'll just scroll through it. If it's 3000 pages... time to dump to file.
So no - by default I use a pager... just about never. Why would I when I have absolutely everything in scrollback by default 99.9% of the time?
---
Don't confuse your preferences with "correct" :P
I'm doing just fine with code and best practices, I'm simply stating that this is a rough edge on an otherwise lovely tool.
I guess it isn't a huge deal to have every user to modify their ssh_config instead, but it's an ergonomic pain point for many new users.
> Don't confuse your preferences with "correct" :P
Don't overlook the point by fixating on a technicality > I'm doing just fine with code and best practices
Yet, you aren't following best practices > So no - by default I use a pager... just about never. Why would I when I have absolutely everything in scrollback by default 99.9% of the time?
Fewer capabilities. But those were already explained and not just by me. There really should be no need for such huge scrollbacks, you have history > I'm simply stating that this is a rough edge on an otherwise lovely tool.
No one has disagreed with this point. I think everyone even agrees