Urxvt with true color?

True color support was merged into the rxvt-unicode terminal emulator a couple years ago, but there hasn’t been an official release since.

I’m interested in overriding the src of the nix rxvt_unicode package to get true color support, but as a git user with no CVS experience, I’m not sure how to go about doing so. In the past, when writing overlays and overrides, I’ve relied on the fact that git hosts often provide tarballs for individual commits.

The source for rxvt_unicode looks like:

src = fetchurl {
  url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
  sha256 = "1pddjn5ynblwfrdmskylrsxb9vfnk3w4jdnq2l8xn2pspkljhip9";
};

where version is "9.22".

I found a git mirror of the CVS repo, so I’ll try that. I’m curious though, haven’t any other nixers cried out for true color in their urxvt, and what solutions have they tried?

I was using Alacritty for a year or two (which supports true color), but recently switched to good old xterm. This also supports 24-bit true color, and it’s apparently the only terminal emulator that properly sends control codes like C-j to emacs -nw out of the box.

Additionally, even though it’s ancient with an “unmaintainable” code base, it has significantly better input latency performance than any modern terminal emulator:

For me this is the only stat that matters, because I use tmux / xmonad / emacs for all of the other terminal features.

I used this guide to get myself setup with full 24-bit true color in xterm, tmux, and emacs -nw, btw:

For the original question, it should be relatively straightforward to add an overlay that uses fetchFromGitHub against the mirror you provided. This doesn’t yet build (needs some more dependencies or something), but it’s the first step if you want to go in this direction:

# ~/.config/nixpkgs/overlays/rxvt.nix
self: super: {

  rxvt_unicode = super.rxvt_unicode.overrideAttrs(old: {
    version = "2020-02-06";
    src = super.fetchFromGitHub {
      owner = "exg";
      repo = "rxvt-unicode";
      rev = "d1f0c23e1e420d2bb707670aef8619bfa8ad3726";
      sha256 = "086vhp3sppdn085w4z53y15izvglxsazslsf241n191paybpwnqa";
    };
  });

}
1 Like

I banged my head against the wall for a while trying to find a solution for the missing dependency. It looks like some stuff was extracted into a separate libptytty project, and when building from the git mirror, libptytty was missing.

The solution was surprisingly simple: use fetchcvs to grab the rxvt-unicode source from the official source rather than the mirror. Being unfamiliar with cvs, the hard part was identifying the right cvsRoot to use, which I found listed at the bottom of http://software.schmorp.de/pkg/rxvt-unicode.html under “Resources”.

The overlay that finally worked was:

self: super: {
  rxvt_unicode = super.rxvt_unicode.overrideAttrs (old: {
    version = "2020-02-12";
    src = super.fetchcvs {
      cvsRoot = ":pserver:anonymous@cvs.schmorp.de/schmorpforge";
      module = "rxvt-unicode";
      date = "2020-02-12";
      sha256 = "0n8z3c8fb1pqph09fnl9msswdw2wqm84xm5kaax6nf514gg05dpx";
    };
  });
}

Thanks for your help!

1 Like