New features in weltschmerz 1.9.0

Wolfgang Müller

It’s been a very long time since the last post on updates for weltschmerz, my terminal emulator. The last post, reporting on version 1.5.0, was published around 4 years ago. With today’s release of version 1.9.0 it’s finally time to catch up!

Drag & drop

Commit 2fdbf96, released with version 1.6.0, makes weltschmerz act as a drop target for both text and URIs, making it possible to drag and drop files, links, and ordinary text from other applications into the terminal. If files are dropped, weltschmerz normalizes them for use in the shell so that you don’t need to worry about escaping spaces or such.

FreeBSD compatibility

Version 1.7.0 was mainly a compatibility release that targeted the FreeBSD operating system. Most changes were related to the Makefile, which now uses more compatible invocations of install(1) and drops usage of $< , which FreeBSD make only allows for suffix-transformation rules and not explicit rules like GNU make does. See commit 623985d and commit 9e23bc6.

In addition, since commit d6090f7, weltschmerz now also considers /compat/linux/proc when trying to determine the current working directory (and OSC 7 support has been turned off). These changes make weltschmerz work flawlessly out of the box with FreeBSD.

Configurable resize hints

The release of version 1.8.0 added another small feature: configurable resize hints. For the longest time, weltschmerz had defaulted to allowing size changes only in increments of the cell size. This was to make sure that there’s no padding around the terminal and that the window was always perfectly sized for its contents. This is especially advantageous when using floating windows.

However, when weltschmerz was then put into a tiled context, instead of having padding on the terminal side, now there were visible gaps between the actual windows. Sadly there is no perfect solution for this, but I felt that this behaviour should at least be configurable.

Removing deprecated functionality

Over the years I have also removed a bunch of deprecated functionality from weltschmerz.

spawn_async

With the release of 1.6.0 came a change that was completely inconsequential for users but quite important for myself because it had been a cause for annoyance for basically the entire existence of the program: the deprecation of spawn_sync. This function is used when weltschmerz needs to spawn a process; the shell, for example.

The problem: upstream had deprecated spawn_sync but the Vala bindings for its replacement, spawn_async, were broken. The cause of the breakage had been known since 2018, but the fix was only committed in early 2022. I noticed only quite a bit later and fixed it with commit a2ab0ab in November of 2022.

Switching weltschmerz to termprops

With VTE 0.78 came the deprecation of a bunch of helper functions in favour of a termprop-based system. weltschmerz specifically was using the get_window_title and get_current_directory functions which have been subsumed by the XTERM_TITLE and CURRENT_DIRECTORY_URI termprops. Version 1.9.0 now uses the termprops directly.

This would usually be uninteresting for the end user, but the migration away from get_window_title actually also fixes a bug that caused weltschmerz to segfault. It seems that the Vala bindings for the vte.window_title property are buggy and indicate that the property is a non-nullable string when in reality vte.window_title is internally translated to a call to get_window_title which returns a nullable string. weltschmerz was assuming vte.window_title was correct and never checked for null.

This is not an issue unless you can force the window title to be null. My partner found a clever way to do so: by passing an overlong title to the OSC mechanism, a code path in VTE is triggered that leaves the window title as null. Running the following in versions previous to 1.9.0 would reliably crash weltschmerz:

python -c 'print(f\'\\033]0;{"."*1025}\\033\\\\\')'

Makefile and meson.build improvements

My partner also contributed two more improvements to the Makefile, which now standardizes on one way of doing variable expansions and allows passing CFLAGS to the compiler. In addition, I finally made meson use the locale keyword for install_man instead of installing the translated manual pages manually.

“bold is bright” and IPv6 addresses

A new feature in 1.9.0 is the bold-is-bright setting which controls whether bold characters are also automatically drawn in bright colors, like some older terminal emulators do. This change had been sitting around uncommitted for a very long time and I finally decided to just include it.

And last but not least my partner taught the URL matching mechanism about bare IPv6 addresses which are now clickable.


That’s it for this update. See NEWS for the full set of changes, and 1.5.0..1.9.0 for all relevant commits. Download weltschmerz on its project page.