Skip to content
Myr

Nullify unwanted FZF_DEFAULT_* variables in tmux popup

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

Fix #4298

authored by Junegunn Choi · committed by Junegunn Choi · parent 8868d7c · Browse files · 1 file+3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:src/proxy.go+3 added-3 removed
88 unmodified lines
89 command = fmt.Sprintf(`command cat %q | %s > %q`, input, commandPrefix, output)90 }91 }9293 // To ensure that the options are processed by a POSIX-compliant shell,94 // we need to write the command to a temporary file and execute it with sh.95 var exports []string93 // * 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="}96 needBash := false97 if withExports {98 validIdentifier := regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)99 for _, pairStr := range os.Environ() {
62 unmodified lines