Hacker News new | ask | show | jobs
by medimikka 538 days ago
Config being a programming language has insane advantages. Not only can I error check my config in vim or Visual Code, I can do insane things with logic that just don't work in other config file approaches. My laptop is connected to a 32" 4k monitor at work, standalone while traveling, and to a 27" 2k at home. WezTerm "knows" that, and sets things such as font size and line height automagically.

Even more, I can have split logic based on window size, window titles that show me who also checked out a file while I am inside an editor, even per-window color and font schemes.

All apps should use something like Lua for their config.

5 comments

It's great that you (and many others) find it useful, but I genuinely have no idea what this is about. I switch my iTerm from my 13" MBP, 32" monitor, and iPad all the time, and I don't need any config to make it work. Maybe I just don't care enough about this stuff but I don't see what I would even configure this way.

Anyway, this is the reason I love the new wave of terminals, they bring new stuff on the table and anyone can find one they love. I just installed Ghostty and it works as I expect out of the box, with even less config (0) than I have on iTerm. And it's fast. Now I just hope they'll add a config UI some day (one of the reasons I prefer static config files: you can't really get a UI with a programming language) and I'll be in terminal heaven

If you don't care about this stuff you'll just as easily configure in a static key=value table whatever you like, lua doesn't limit you here. It's benefits are all optional
I've used wezterm for years and have never done anything fancy with the config, but this sounds awesome. I'd really appreciate it if you could link your config or a similar resource.
I just started using wezterm, my config isn't as mature or fancy, but I already found a spot where lua config is making me happy. I added a feature so I can command-click on Github PR numbers in Wezterm to take me to that PR on Github.com. Here's a permalink to the code: https://github.com/justjake/Dotfiles/blob/030c5d2b43e944df55...

The way this works in Wezterm is you can add regexes that match text in the terminal and format that text as links. So, I turn #(\d+) into "GITHUB_PR:$1" and then add a "on link clicked" callback to handle that special URL form by shelling out to `gh pr view --web $1` in the same working directory as the clicked pane.

This is what I love about wezterm. I have a whole system that detects lightness and changes themes automatically, and also sends commands down to any open nvim instances to switch colourschemes there. The only downside is that there is no going back for me haha.

Lua is also simple enough that if you want to have a static config, you can have a single table that is very json-like.

I have a similar setup could you link your config? Id like to adapt it.
Hmmm this actually has me thinking of looking at WezTerm now hah