Re: [dev] [dvtm] TERMINFO problem with copymode

From: Marc André Tanner <mat_AT_brain-dump.org>
Date: Wed, 7 Oct 2015 22:04:03 +0200

On Mon, Aug 31, 2015 at 12:17:06PM -0400, Ross Mohn wrote:
> 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
> PREFIX=~/local
> 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
> TERMINFO=~/local/share/terminfo
>
> 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.

Environment variables should be passed on. I just tried the following:

 $ TEST=Hello dvtm

Then within dvtm the variable is available as can be confirmed by:

 $ env | grep TEST

Now enter copy mode (to vis) where we run:

 :r ! env | grep TEST

The variable is read as expected ...

> 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.

I can confirm this, but do not really understand why it is happening.
There is a loop which closes any file descriptor >= 3 which should leave
stderr intact.

-- 
 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
Received on Wed Oct 07 2015 - 22:04:03 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 07 2015 - 22:12:09 CEST