If you have some issues, questions or comments, there is a GitHub discussion about this procedure!
Why Ghostty?...
At first I did not understand why Ghostty got so much hype. I've used WezTerm and was pretty satisfied with it (even did some fun scripting for transparent window background when the window is out of focus).
Although there were some quirks with WezTerm:
I could not get WezTerm to forward macOS
CMD + ...
keybindings to Zellij,
This is what we're gonna solve.I had to set a separate DPI and font size for each of my external displays and the integrated Macbook screen.
Automatically works in Ghostty.
Install...
Ghostty
Well, head over to the Ghostty install docs. I assume you already did that if you clicked on this article.Fish
A shell environment - but modern. Easily extendable.Zellij
Zellij is basically a modern type of tmux, written in Rust - of course.
Integrate
We have some requirements:
Automatically launch Zellij when opening a Terminal in Ghostty
We do not want Zellij if we're in another Terminal - such as the integrated Terminal in JetBrains IDEs
Forward typical macOS tab-management keybindings to Zellij
Ghostty as an initial-command
config option but I didn't feel like the Ghostty config was the right place for our environment check. Additionally, we would loose the automatic shell detection when overriding this config option.
For keybindings, I do not need native Terminal tabs but rather want to use tabs + panes in Zellij. So I want to use the usual key combinations of Command + n
(new tab) and Command + Option + Arrow
for switching between them.
Ghostty ghostty
Config file
See Ghostty Configuration docs, I've placed my config in ~/.config/ghostty/ghostty
.
The default configuration works really well for me out of the box, I've only made some minor adjustments:
mouse-scroll-multiplier = 0.5
window-decoration = true
window-padding-x = 8
window-padding-y = 8
theme = catppuccin-mocha
font-feature = -liga
macos-titlebar-style = transparent
# Unbind CMD+... keys so they will be forwarded to Zellij
keybind = cmd+t=unbind
keybind = cmd+n=unbind
keybind = cmd+c=unbind
keybind = cmd+w=unbind
keybind = cmd+opt+left=unbind
keybind = cmd+opt+right=unbind
Fish config.fish
Ghostty should automatically detect your Shell if you've installed Fish correctly. If this is not the case, add the following config line to your Ghostty config file.
+ shell-integration = fish
See the Fish tutorial docs for more info, typically the config should be placed in ~/.config/fish/config.fish
.
# Unset the default fish greeting text which messes up Zellij
set fish_greeting
# Check if we're in an interactive shell
if status is-interactive
# At this point, specify the Zellij config dir, so we can launch it manually if we want to
export ZELLIJ_CONFIG_DIR=$HOME/.config/zellij
# Check if our Terminal emulator is Ghostty
if [ "$TERM" = "xterm-ghostty" ]
# Launch zellij
eval (zellij setup --generate-auto-start fish | string collect)
end
end
Zellij config.kdl
Config file
Above, we've specified the ZELLIJ_CONFIG_DIR
, so place your config.kdl
in that folder, in my case ~/.config/zellij/config.kdl
keybinds {
normal {
bind "Super c" { Copy; }
bind "Super Alt Left" { GoToPreviousTab; }
bind "Super Alt Right" { GoToNextTab; }
bind "Super w" { CloseTab; }
bind "Super n" { NewTab; }
bind "Super t" { NewTab; }
}
}
If Zellij is not starting into Fish shell, add the following config line to your config.kdl
+ default_shell "fish"
And this is what we got!
Read more...
How to style <progress> Element with Tailwind
Styling the HTML progress element isn't as straight forward as you think. We'll take a look and craft pretty progresses with Tailwind CSS.
Laravel dd() not showing Dump as HTML
I recently ran into an issue where the Laravel dd() Helper did not show anything, what the heck?
Comments