diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-08-22 19:13:30 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-08-22 19:24:01 +0900 |
| commit | 0a8ff7899c7d09457d3896fcce2d4dcffcc13e17 (patch) | |
| tree | b7d915edff9efded244faf9edc5f79d0db4526f1 | |
| parent | f9d7877d8b01e58c53c5b7f746f02c8ab81b17d6 (diff) | |
| download | fzf-0a8ff7899c7d09457d3896fcce2d4dcffcc13e17.tar.gz | |
Do not unset FZF_DEFAULT_* variables when using winpty
Fix #4497
Fix #4400
| -rw-r--r-- | src/proxy.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/proxy.go b/src/proxy.go index 958ae26f..590c6b68 100644 --- a/src/proxy.go +++ b/src/proxy.go @@ -90,11 +90,12 @@ func runProxy(commandPrefix string, cmdBuilder func(temp string, needBash bool) } } - // * Write the command to a temporary file and run it with sh to ensure POSIX compliance. - // * Nullify FZF_DEFAULT_* variables as tmux popup may inject them even when undefined. - exports := []string{"FZF_DEFAULT_COMMAND=", "FZF_DEFAULT_OPTS=", "FZF_DEFAULT_OPTS_FILE="} + // Write the command to a temporary file and run it with sh to ensure POSIX compliance. + var exports []string needBash := false if withExports { + // Nullify FZF_DEFAULT_* variables as tmux popup may inject them even when undefined. + exports = []string{"FZF_DEFAULT_COMMAND=", "FZF_DEFAULT_OPTS=", "FZF_DEFAULT_OPTS_FILE="} validIdentifier := regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`) for _, pairStr := range os.Environ() { pair := strings.SplitN(pairStr, "=", 2) |
