Okay, I Like WezTerm
Alex Plescan shares his transition from iTerm 2 to WezTerm, highlighting its Lua-based configuration, hot reloading feature, and extensive customization options, making it a flexible terminal emulator for macOS users.
Read original articleAlex Plescan shares his experience transitioning from iTerm 2 to WezTerm, a terminal emulator that offers a text-based configuration system using Lua. Initially skeptical, he found WezTerm's powerful API and flexibility appealing, especially for sharing configurations across devices. Plescan highlights the ease of customizing the terminal's appearance, keybindings, and functionality through Lua scripts, which allow for complex configurations compared to traditional UI-based settings. He emphasizes the benefits of WezTerm's hot reloading feature, enabling instant updates to configurations without restarting the terminal. The post serves as a guide for beginners, detailing steps to install WezTerm, set up configurations, and customize the terminal's look and feel, including color schemes and fonts. Plescan also discusses the integration of system appearance changes and the use of events to enhance the terminal's functionality. Overall, he finds WezTerm to be a visually appealing and highly customizable terminal option, particularly for macOS users.
- Alex Plescan transitioned from iTerm 2 to WezTerm for its Lua-based configuration.
- WezTerm allows for complex configurations and instant updates through hot reloading.
- The terminal supports over 1,000 color schemes and dynamic theming based on system appearance.
- Plescan provides a guide for beginners on setting up and customizing WezTerm.
- The post highlights the flexibility and functionality of WezTerm's API for enhanced user experience.
Related
Entering text in the terminal is complicated
The article delves into text input complexities in terminals, categorizing input modes and offering tips like using Ctrl+A for line navigation. Understanding input systems enhances efficiency in the command line.
Terminal Workspace with Batteries Included
Zellij is a workspace designed for developers and terminal enthusiasts, offering a simple yet powerful terminal multiplexer. It emphasizes customization, automation, collaboration, UX features, and a plugin system. Explore further on GitHub.
Advanced Terminal Tips and Tricks
The blog post shares advanced terminal tips by Daniel Kleinstein, covering CLI productivity enhancements like tmux scripting, fzf integration, /dev/stdin usage, SSH multiplexing, and bash shortcuts. Practical examples emphasize efficiency.
Troubleshooting: Terminal Lag
Tavis Ormandy addresses slow xterm performance on Windows, identifying a window fading effect as a key issue. He implements a caching solution, reducing startup time to approximately 366ms, comparable to Fedora.
Things I've learned building a modern TUI Framework
The development of the Textual framework faces challenges with emoji rendering, emphasizing smooth animations, efficient data handling, and the use of `lru_cache` and the fractions module for performance and accuracy.
But the straw that broke my back with using kitty was, I'd end up encountering issues or trying to recreate some of iTerm2's features, only to end up time and again on kitty's maintainer's terse and dismissive comments.
e.g. IIRC his answer to "How do I set up tmux with kitty?" was something like "Don't, tmux is dumb" and closing it. Eventually I gave up.
(Former avid Alacritty user but needed better modifier support for remote emacs.)
(in case you're wondering, the page I mean is https://wezfurlong.org/wezterm/copymode.html, not https://wezfurlong.org/wezterm/quickselect.html, which sounds like what I was looking for, but is something completely different - also very handy and a great idea, but not what I was after)
One big use case I have is: mosh+tmux-like functionality from my macos laptop to my work Linux machine. I always have a session running so I can do things on my work machine from my Mac. It gives a re-connectable session plus panes and tabs so I can do work when I'm away from my desk. It's top notch.
My favorite and often overlooked feature is that wezterm is fully cross os, so if you work like me in Linux, macOS and Windows, then you can just learn wezterm and be done. I even share large parts of my terminal config across os:es.
"When enabled, vertical lines of pipe characters | will be interpreted as pane dividers (as in vim or emacs) and selection will wrap at them."
(For me, it's selecting text in irc.)
I had really started to feel it slow down lately. It hit the breaking point when I was cmd-tab-ing and found myself waiting for more than a second just for the terminal to appear.
Looked around, evaluated a couple alternatives and none of them quite fit my taste. One terminal required an account/login to operate, which is a big no IMO, another was written in {Java,Type}Script so simple commands like `yes` would break it due to the async nature of streams in node.js.
I really like WezTerm so far. It's quite fast, very much configurable and comes with the theme I was configuring with iTerm2 out of the box (OneDark (base16)).
My only trouble with it was in the beginning when I had to add the configs for cmd-left and cmd-right in lua config, I really hoped they'd be in there with the defaults.
Emacs uses Lisp in a similar way. What other applications use a programming language for their configuration?
Given that I do already use a window manager like sway, is there much else worthwhile compared to any other terminal emulator?
After switching employers I no longer have a Mac to run iTerm2 in. So I decided to simply reduce the number of apps I require by running my terminal inside Emacs. The emacs-libvterm project is excellent. These days I no longer need a terminal emulator app.
Btw one gotcha on macOS during setup is that the left Option/Alt key does not emit the usual special character mappings, but the right Option key does. You can configure that too!
Cheers Wez!
!= goes to weird ≠ utf8 char. I like != better!
Command-K clears the scroll back but NOT the screen.
Updates:
config.harfbuzz_features = {"calt=0", "clig=0", "liga=0"}
Command-L
^ There's a host of built-in color schemes.
Wezterm with Zellij becomes amazing with how it just simply gets out of the way, even lets you remove window decorations entirely. I've heard Wezterm has a multiplexer too, but just haven't tried it.
Video demonstrating the speedup: https://x.com/fleetwood___/status/1807772624518316495
I vaguely remember my main requirement was being able to configure CMD+D and CMD+SHIFT+D as split panes vertically and horizontally as I wasn't willing to retrain my fingers to learn new keystrokes for that. Within a version of two after I switched (back then, those were weeks or less apart), all my complaints were resolved and I never looked back.
My config is fairly minimal, but perfect for my needs. What else can one want?
The author is not interested in trying to fix this issue, which is totally fine, as they point out font rendering is very subjective, but I'm also not willing to use a terminal that looks worse, even though I like many other things about it better.
P.S.: I am temporary back to Kitty in NixOS because I recently switched from Sway to Hyprland and the current release of WezTerm seems to be having some issues in Hyprland. But will switch back once this issue is solved, I know it is fixed in the main branch for example, but I would prefer to use nixpkgs cache instead of building it from source.
In terms of use-case, I just disable all its keybindings and use it as a tmux terminal. I admit I didn't look for solutions, but I just can't go away from tmux's session restoration capabilities.
That doesn't make it perfect. Mouse themes are applied inconsistently as I use Gnome on Wayland. It also seems to be a problem when using neovim, but I can't prove it clearly enough to want to file a bug with anyone. Besides, everything I need to do still works and I rarely use the mouse unless I am copying random gobs of text.
I am sticking with wezterm for the moment. I have no reason to leave it at this point and it helped me reduce the complexity of my stack a teeny bit.
Had the opportunity to work on a project together at work some years back and I can only aspire to be 1/10th as good of an engineer as him. A true hacker.
But I hit a snag. On macOS, it's standard that in any text window, to select everything for copying, you hit Command-a.
But Command-a in wezterm just printed an "a" character. What?
I spent a while looking in the docs and issues, but couldn't figure out how to Select All.
I don't think I should have to justify it, but in case someone's wondering - it's useful if you want to search or parse an entire Terminal session using some other process (eg, grep), or edit it, or just persist it for example.
Regardless of why, "Select All" is such a standard function it felt quite strange it wasn't suported out of the box.
I use the Embark color theme, which I don't see represented on the wezterm themes page: https://github.com/dmshvetsov/wezterm-embark-theme
I also like a slowly-blinking block cursor, a specific font, ligatures etc. Feel free to raid my config: https://github.com/pmarreck/dotconfig/blob/yolo/wezterm/wezt...
I love that I can use the same config on macOS and Linux as I use both machines often.
I spend a lot of time in a terminal and just use whatever’s there. Terminal.app or gnome-terminal. Before that it was xterm. Perhaps the only customization is modifier key on Mac as meta.
Okay, maybe for just a few minutes.
That's indeed one of its best features (despite the warts of the language) as you're not as limited in what you can do vs. the data serialization alternative
The built in multiplexing is like magic.
It looks nice just as a basic setup (key = value type stuff), but you can do really complex dynamic configurations with it (like the dark-mode config in the linked article).
Hammerspoon is another, you can do so many things with it - I replicated most of Rectangle/Manget with Hammerspoon+Lua myself and now I can do the minor tweaks I couldn't do with the pre-packaged apps.
The Lua configuration is very intuitive as well.
I do get some indirect crashes when Xwayland crashes, which is rare. I had to disable Wayland support in wezterm because the window decorations aren't great yet.
Ideally fuzzy search of just the commands I’ve entered and not the full scroll history as some results take many hundreds of lines.
Is there a wezterm community where I can ask this and similar questions?
I need to look into all the advanced features.
https://wezfurlong.org/wezterm/multiplexing.html
Thanks for posting
Curious what sort of features and other things you look for when looking or comparing terminals like WezTerm and the like?
What are your deal breakers and must haves of a terminal emulator?
It feels like one of these "ricer" things like opening 9 terminals just to run cmatrix and screenfetch.
Granted it’s not meant to be edited directly but rather via the GUI, but yeah it’s possible to persist it if you want.
I looked at WezTerm a long while ago, didn't even realize I'd already had it starred. Will try it out again soon. It's just another one of those things, that I prefer to use the same applications (if I can) on all the platforms I use.
Yeah, iTerm2 has a lot of other fancy features, but I just rarely or never used them, so don't really feel like I miss anything.
Related
Entering text in the terminal is complicated
The article delves into text input complexities in terminals, categorizing input modes and offering tips like using Ctrl+A for line navigation. Understanding input systems enhances efficiency in the command line.
Terminal Workspace with Batteries Included
Zellij is a workspace designed for developers and terminal enthusiasts, offering a simple yet powerful terminal multiplexer. It emphasizes customization, automation, collaboration, UX features, and a plugin system. Explore further on GitHub.
Advanced Terminal Tips and Tricks
The blog post shares advanced terminal tips by Daniel Kleinstein, covering CLI productivity enhancements like tmux scripting, fzf integration, /dev/stdin usage, SSH multiplexing, and bash shortcuts. Practical examples emphasize efficiency.
Troubleshooting: Terminal Lag
Tavis Ormandy addresses slow xterm performance on Windows, identifying a window fading effect as a key issue. He implements a caching solution, reducing startup time to approximately 366ms, comparable to Fedora.
Things I've learned building a modern TUI Framework
The development of the Textual framework faces challenges with emoji rendering, emphasizing smooth animations, efficient data handling, and the use of `lru_cache` and the fractions module for performance and accuracy.