[dev] [dvtm] TERMINFO problem with copymode

From: Ross Mohn <rpmohn_AT_waxandwane.org>
Date: Mon, 31 Aug 2015 12:17:06 -0400

Over the weekend, I finally put in the hours to figure out why dvtm's
copymode works fine at home, but doesn't work at all on my servers at
the office. At work, I use shared UNIX hosts without root access. I
compile with
so that I have my own compiled apps and customizations. My dvtm terminal
info files are installed under $PREFIX, and when I'm running inside dvtm
I have set

The problem occurs when the child process of vt_forkpty() calls execvp()
to switch to the editor program. The environment variable TERM is set to
dvtm-256color, but TERMINFO is not set. The call to execvp() is
successful, but the editor crashes because it doesn't understand the
TERM (I tested with vis, vim, and less). I don't know the best way to
fix this so for myself, for now, I just hardcoded
    setenv("TERMINFO", "~/local/share/terminfo", 1);
after the setenv() line for TERM.

I thought through some actual solutions, but none seemed to fit well.
I'd love to hear some ideas!

Incidentally, the fprintf(stderr, ...) statement after execvp() doesn't
do anything because the child's stderr doesn't go anywhere meaningful.
The call to execvp() wasn't failing in the problem above, but I tested
forcing it to fail. I ended up opening a specific file, rather than
stderr, and had fprintf() write directly to it, but that's obviously not
a general solution. The fprintf() should either be fixed or removed.

Thanks -Ross
Received on Mon Aug 31 2015 - 18:17:06 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 31 2015 - 18:24:08 CEST