Skip to content
Myr

Remove temp files before 'become' when using --tmux option

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

Close #4283 But the temp files for the `f` flags in the 'become' template will not be removed, because we will need them after "becoming" another program. e.g. fzf --bind 'enter:become:cat {f}'

authored by Junegunn Choi · committed by Junegunn Choi · parent 6392538 · Browse files · 1 file+5 added−2 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+5 added−2 removed

  • other:+5 added−2 removed

1 file+5 added−2 removed

modified:src/proxy.go+5 added-2 removed
57 unmodified lines
58 }59 })60 }()6162 var command string62 var command, input string63 commandPrefix += ` --no-force-tty-in --proxy-script "$0"`64 if opts.Input == nil && (opts.ForceTtyIn || util.IsTty(os.Stdin)) {65 command = fmt.Sprintf(`%s > %q`, commandPrefix, output)66 } else {67 input, err := fifo("proxy-input")67 input, err = fifo("proxy-input")68 if err != nil {69 return ExitError, err70 }71 defer os.Remove(input)
75 unmodified lines
147 ttyin, err := tui.TtyIn()148 if err != nil {149 return ExitError, err150 }151 os.Remove(temp)152 os.Remove(input)153 os.Remove(output)154 executor.Become(ttyin, env, command)155 }156 return code, err157 }
4 unmodified lines