Skip to content
Myr

Do not unset FZF_DEFAULT_* variables when using winpty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #4497 Fix #4400

authored by Junegunn Choi · committed by Junegunn Choi · parent f9d7877 · Browse files · 1 file+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−3 removed

  • other:+4 added−3 removed

1 file+4 added−3 removed

modified:src/proxy.go+4 added-3 removed
88 unmodified lines
89 command = fmt.Sprintf(`command cat %q | %s > %q`, input, commandPrefix, output)90 }91 }9293 // * Write the command to a temporary file and run it with sh to ensure POSIX compliance.94 // * Nullify FZF_DEFAULT_* variables as tmux popup may inject them even when undefined.95 exports := []string{"FZF_DEFAULT_COMMAND=", "FZF_DEFAULT_OPTS=", "FZF_DEFAULT_OPTS_FILE="}93 // Write the command to a temporary file and run it with sh to ensure POSIX compliance.94 var exports []string95 needBash := false96 if withExports {97 // Nullify FZF_DEFAULT_* variables as tmux popup may inject them even when undefined.98 exports = []string{"FZF_DEFAULT_COMMAND=", "FZF_DEFAULT_OPTS=", "FZF_DEFAULT_OPTS_FILE="}99 validIdentifier := regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)100 for _, pairStr := range os.Environ() {101 pair := strings.SplitN(pairStr, "=", 2)102 if validIdentifier.MatchString(pair[0]) {
60 unmodified lines