~rockorager/tcell-term

6805a6d75db82c2e1f51c1fb97170c26daf7aea0 — Jason Cox 8 months ago c743293 main v0.10.0
vt: preserve environment of start command

The caller may have already set the command's environment; don't clobber
it when setting TERM.

Signed-off-by: Jason Cox <me@jasoncarloscox.com>
1 files changed, 6 insertions(+), 1 deletions(-)

M vt.go
M vt.go => vt.go +6 -1
@@ 135,7 135,12 @@ func (vt *VT) Start(cmd *exec.Cmd) error {
	if vt.TERM == "" {
		vt.TERM = "xterm-256color"
	}
	cmd.Env = append(os.Environ(), "TERM="+vt.TERM)

	env := os.Environ()
	if cmd.Env != nil {
		env = cmd.Env
	}
	cmd.Env = append(env, "TERM="+vt.TERM)

	// Start the command with a pty.
	var err error