mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 13:50:11 +00:00
Because we generally read this value from an environment variable, we the resulting value can include a trailing slash (as on macOS). This results in less-friendly path operations for callers who are building paths based on this value. `std.fs.path.join()` handles trailing slashes just fine, but it's an allocating API. For callers who just want to format a path, they have to assume they need to include their own path separator. We can make this friendlier by always trimming trailing path separators from the environment variable values before returning the slice. This behavior matches "higher-level" languages' standard libraries (I checked Python, Node, Ruby, and Perl). Other "systems" languages (Go, Rust) just return the system value as-is, like we were doing before.