Skip to content
Myr

Add --with-shell for shelling out with different command and flags (#3746)

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

Close #3732

authored by Junegunn Choi · committed by GitHub · parent b86a967 · Browse files · 13 files+194 added−128 removed
This commit

State

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

Diff stats

13 files+194 added−128 removed

  • tests:+1 added−1 removed
  • other:+193 added−127 removed

13 files+194 added−128 removed

modified:man/man1/fzf.1+12 added-2 removed
816 unmodified lines
817.RS818e.g. \fBfzf --multi | fzf --sync\fR819.RE820.TP821.B "--with-shell=STR"822Shell command and flags to start child processes with. On *nix Systems, the823default value is \fB$SHELL -c\fR if \fB$SHELL\fR is set, otherwise \fBsh -c\fR.824On Windows, the default value is \fBcmd /v:on/s/c\fR when \fB$SHELL\fR is not825set.826827.RS828e.g. \fBgem list | fzf --with-shell 'ruby -e' --preview 'pp Gem::Specification.find_by_name({1})'\fR829.RE830.TP831.B "--listen[=[ADDR:]PORT]" "--listen-unsafe[=[ADDR:]PORT]"832Start HTTP server and listen on the given address. It allows external processes833to send actions to perform via POST method.834
106 unmodified lines
941.BR 1 " No match"942.br943.BR 2 " Error"944.br945.BR 127 " Invalid shell command for \fBbecome\fR action"946.br947.BR 130 " Interrupted with \fBCTRL-C\fR or \fBESC\fR"948949.SH FIELD INDEX EXPRESSION950
501 unmodified lines
1452call.14531454 \fBfzf --bind "enter:become(vim {})"\fR14551444\fBbecome(...)\fR is not supported on Windows.14451456.SS RELOAD INPUT14571458\fBreload(...)\fR action is used to dynamically update the input list1459without restarting fzf. It takes the same command template with placeholder
99 unmodified lines
modified:src/util/util_unix.go+48 added-8 removed
1 unmodified line
23package util45import (6 "fmt"7 "os"8 "os/exec"9 "strings"10 "syscall"1112 "golang.org/x/sys/unix"13)1413// ExecCommand executes the given command with $SHELL14func ExecCommand(command string, setpgid bool) *exec.Cmd {15type Executor struct {16 shell string17 args []string18 escaper *strings.Replacer19}2021func NewExecutor(withShell string) *Executor {22 shell := os.Getenv("SHELL")23 args := strings.Fields(withShell)24 if len(args) > 0 {25 shell = args[0]26 args = args[1:]27 } else {16 if len(shell) == 0 {17 shell = "sh"28 if len(shell) == 0 {29 shell = "sh"30 }31 args = []string{"-c"}32 }19 return ExecCommandWith(shell, command, setpgid)3334 var escaper *strings.Replacer35 tokens := strings.Split(shell, "/")36 if tokens[len(tokens)-1] == "fish" {37 // https://fishshell.com/docs/current/language.html#quotes38 // > The only meaningful escape sequences in single quotes are \', which39 // > escapes a single quote and \\, which escapes the backslash symbol.40 escaper = strings.NewReplacer("\\", "\\\\", "'", "\\'")41 } else {42 escaper = strings.NewReplacer("'", "'\\''")43 }44 return &Executor{shell, args, escaper}45}4622// ExecCommandWith executes the given command with the specified shell23func ExecCommandWith(shell string, command string, setpgid bool) *exec.Cmd {24 cmd := exec.Command(shell, "-c", command)47// ExecCommand executes the given command with $SHELL48func (x *Executor) ExecCommand(command string, setpgid bool) *exec.Cmd {49 cmd := exec.Command(x.shell, append(x.args, command)...)50 if setpgid {51 cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}52 }53 return cmd54}5556func (x *Executor) QuoteEntry(entry string) string {57 return "'" + x.escaper.Replace(entry) + "'"58}5960func (x *Executor) Become(stdin *os.File, environ []string, command string) {61 shellPath, err := exec.LookPath(x.shell)62 if err != nil {63 fmt.Fprintf(os.Stderr, "fzf (become): %s\n", err.Error())64 Exit(127)65 }66 args := append([]string{shellPath}, append(x.args, command)...)67 SetStdin(stdin)68 syscall.Exec(shellPath, args, environ)69}7071// KillCommand kills the process for the given command72func KillCommand(cmd *exec.Cmd) error {73 return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL)74}
19 unmodified lines
modified:src/util/util_windows.go+74 added-32 removed
4 unmodified lines
5import (6 "fmt"7 "os"8 "os/exec"9 "regexp"10 "strings"11 "sync/atomic"12 "syscall"13)1415type Executor struct {16 shell string17 args []string14var shellPath atomic.Value18 shellPath atomic.Value19}2021func NewExecutor(withShell string) *Executor {22 shell := os.Getenv("SHELL")23 args := strings.Fields(withShell)24 if len(args) > 0 {25 shell = args[0]26 } else if len(shell) == 0 {27 shell = "cmd"28 }2930 if len(args) > 0 {31 args = args[1:]32 } else if strings.Contains(shell, "cmd") {33 args = []string{"/v:on/s/c"}34 } else if strings.Contains(shell, "pwsh") || strings.Contains(shell, "powershell") {35 args = []string{"-NoProfile", "-Command"}36 } else {37 args = []string{"-c"}38 }39 return &Executor{shell: shell, args: args}40}4142// ExecCommand executes the given command with $SHELL43// FIXME: setpgid is unused. We set it in the Unix implementation so that we44// can kill preview process with its child processes at once.45// NOTE: For "powershell", we should ideally set output encoding to UTF8,46// but it is left as is now because no adverse effect has been observed.17func ExecCommand(command string, setpgid bool) *exec.Cmd {18 var shell string19 if cached := shellPath.Load(); cached != nil {47func (x *Executor) ExecCommand(command string, setpgid bool) *exec.Cmd {48 shell := x.shell49 if cached := x.shellPath.Load(); cached != nil {50 shell = cached.(string)51 } else {22 shell = os.Getenv("SHELL")23 if len(shell) == 0 {24 shell = "cmd"25 } else if strings.Contains(shell, "/") {52 if strings.Contains(shell, "/") {53 out, err := exec.Command("cygpath", "-w", shell).Output()54 if err == nil {55 shell = strings.Trim(string(out), "\n")56 }57 }31 shellPath.Store(shell)58 x.shellPath.Store(shell)59 }33 return ExecCommandWith(shell, command, setpgid)60 cmd := exec.Command(shell, append(x.args, command)...)61 cmd.SysProcAttr = &syscall.SysProcAttr{62 HideWindow: false,63 CreationFlags: 0,64 }65 return cmd66}6736// ExecCommandWith executes the given command with the specified shell37// FIXME: setpgid is unused. We set it in the Unix implementation so that we38// can kill preview process with its child processes at once.39// NOTE: For "powershell", we should ideally set output encoding to UTF8,40// but it is left as is now because no adverse effect has been observed.41func ExecCommandWith(shell string, command string, setpgid bool) *exec.Cmd {42 var cmd *exec.Cmd43 if strings.Contains(shell, "cmd") {44 cmd = exec.Command(shell)45 cmd.SysProcAttr = &syscall.SysProcAttr{46 HideWindow: false,47 CmdLine: fmt.Sprintf(` /v:on/s/c "%s"`, command),48 CreationFlags: 0,68func (x *Executor) Become(stdin *os.File, environ []string, command string) {69 cmd := x.ExecCommand(command, false)70 cmd.Stdin = stdin71 cmd.Stdout = os.Stdout72 cmd.Stderr = os.Stderr73 cmd.Env = environ74 err := cmd.Start()75 if err != nil {76 fmt.Fprintf(os.Stderr, "fzf (become): %s\n", err.Error())77 Exit(127)78 }79 err = cmd.Wait()80 if err != nil {81 if exitError, ok := err.(*exec.ExitError); ok {82 Exit(exitError.ExitCode())83 }50 return cmd84 }85 Exit(0)86}8753 if strings.Contains(shell, "pwsh") || strings.Contains(shell, "powershell") {54 cmd = exec.Command(shell, "-NoProfile", "-Command", command)88func (x *Executor) QuoteEntry(entry string) string {89 if strings.Contains(x.shell, "cmd") {90 // backslash escaping is done here for applications91 // (see ripgrep test case in terminal_test.go#TestWindowsCommands)92 escaped := strings.Replace(entry, `\`, `\\`, -1)93 escaped = `"` + strings.Replace(escaped, `"`, `\"`, -1) + `"`94 // caret is the escape character for cmd shell95 r, _ := regexp.Compile(`[&|<>()@^%!"]`)96 return r.ReplaceAllStringFunc(escaped, func(match string) string {97 return "^" + match98 })99 } else if strings.Contains(x.shell, "pwsh") || strings.Contains(x.shell, "powershell") {100 escaped := strings.Replace(entry, `"`, `\"`, -1)101 return "'" + strings.Replace(escaped, "'", "''", -1) + "'"102 } else {56 cmd = exec.Command(shell, "-c", command)103 return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"104 }58 cmd.SysProcAttr = &syscall.SysProcAttr{59 HideWindow: false,60 CreationFlags: 0,61 }62 return cmd105}106107// KillCommand kills the process for the given command108func KillCommand(cmd *exec.Cmd) error {
21 unmodified lines
modified:src/core.go+6 added-3 removed
119 unmodified lines
120 return true121 })122 }123124 // Process executor125 executor := util.NewExecutor(opts.WithShell)126127 // Reader128 streamingFilter := opts.Filter != nil && !sort && !opts.Tac && !opts.Sync129 var reader *Reader130 if !streamingFilter {131 reader = NewReader(func(data []byte) bool {132 return chunkList.Push(data)130 }, eventBox, opts.ReadZero, opts.Filter == nil)133 }, eventBox, executor, opts.ReadZero, opts.Filter == nil)134 go reader.ReadSource(opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip)135 }136137 // Matcher
42 unmodified lines
180 }181 mutex.Unlock()182 }183 return false181 }, eventBox, opts.ReadZero, false)184 }, eventBox, executor, opts.ReadZero, false)185 reader.ReadSource(opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip)186 } else {187 eventBox.Unwatch(EvtReadNew)188 eventBox.WaitFor(EvtReadFin)
22 unmodified lines
211 // Go interactive212 go matcher.Loop()213214 // Terminal I/O212 terminal := NewTerminal(opts, eventBox)215 terminal := NewTerminal(opts, eventBox, executor)216 maxFit := 0 // Maximum number of items that can fit on screen217 padHeight := 0218 heightUnknown := opts.Height.auto219 if heightUnknown {
183 unmodified lines
modified:src/options.go+6 added-4 removed
118 unmodified lines
119 --expect=KEYS Comma-separated list of keys to complete fzf120 --read0 Read input delimited by ASCII NUL characters121 --print0 Print output delimited by ASCII NUL characters122 --sync Synchronous search for multi-staged filtering123 --with-shell=STR Shell command and flags to start child processes with124 --listen[=[ADDR:]PORT] Start HTTP server to receive actions (POST /)125 (To allow remote process execution, use --listen-unsafe)126 --version Display version information and exit127
228 unmodified lines
356 PreviewLabel labelOpts357 Unicode bool358 Ambidouble bool359 Tabstop int360 WithShell string361 ListenAddr *listenAddress362 Unsafe bool363 ClearOnExit bool364 WalkerOpts walkerOpts
963 unmodified lines
1328 actionArg = spec[offset+1 : len(spec)-1]1329 actions = append(actions, &action{t: t, a: actionArg})1330 }1331 switch t {1330 case actBecome:1331 if util.IsWindows() {1332 exit("become action is not supported on Windows")1333 }1332 case actUnbind, actRebind:1333 parseKeyChordsImpl(actionArg, spec[0:offset]+" target required", exit)1334 case actChangePreviewWindow:1335 opts := previewOpts{}
618 unmodified lines
1954 "padding",1955 nextString(allArgs, &i, "padding required (TRBL / TB,RL / T,RL,B / T,R,B,L)"))1956 case "--tabstop":1957 opts.Tabstop = nextInt(allArgs, &i, "tab stop required")1958 case "--with-shell":1959 opts.WithShell = nextString(allArgs, &i, "shell command and flags required")1960 case "--listen", "--listen-unsafe":1961 given, str := optionalNextString(allArgs, &i)1962 addr := defaultListenAddr1963 if given {
108 unmodified lines
2072 } else if match, value := optString(arg, "--padding="); match {2073 opts.Padding = parseMargin("padding", value)2074 } else if match, value := optString(arg, "--tabstop="); match {2075 opts.Tabstop = atoi(value)2076 } else if match, value := optString(arg, "--with-shell="); match {2077 opts.WithShell = value2078 } else if match, value := optString(arg, "--listen="); match {2079 addr, err := parseListenAddress(value)2080 if err != nil {2081 errorExit(err.Error())
246 unmodified lines
modified:src/reader_test.go+2 added-1 removed
8 unmodified lines
910func TestReadFromCommand(t *testing.T) {11 strs := []string{}12 eb := util.NewEventBox()13 exec := util.NewExecutor("")14 reader := NewReader(15 func(s []byte) bool { strs = append(strs, string(s)); return true },15 eb, false, true)16 eb, exec, false, true)1718 reader.startEventPoller()1920 // Check EventBox
44 unmodified lines
modified:src/reader.go+4 added-3 removed
16 unmodified lines
1718// Reader reads from command or standard input19type Reader struct {20 pusher func([]byte) bool21 executor *util.Executor22 eventBox *util.EventBox23 delimNil bool24 event int3225 finChan chan bool
4 unmodified lines
30 wait bool31}3233// NewReader returns new Reader object33func NewReader(pusher func([]byte) bool, eventBox *util.EventBox, delimNil bool, wait bool) *Reader {34 return &Reader{pusher, eventBox, delimNil, int32(EvtReady), make(chan bool, 1), sync.Mutex{}, nil, nil, false, wait}34func NewReader(pusher func([]byte) bool, eventBox *util.EventBox, executor *util.Executor, delimNil bool, wait bool) *Reader {35 return &Reader{pusher, executor, eventBox, delimNil, int32(EvtReady), make(chan bool, 1), sync.Mutex{}, nil, nil, false, wait}36}3738func (r *Reader) startEventPoller() {39 go func() {
202 unmodified lines
242func (r *Reader) readFromCommand(command string, environ []string) bool {243 r.mutex.Lock()244 r.killed = false245 r.command = &command245 r.exec = util.ExecCommand(command, true)246 r.exec = r.executor.ExecCommand(command, true)247 if environ != nil {248 r.exec.Env = environ249 }250 out, err := r.exec.StdoutPipe()
12 unmodified lines
modified:src/terminal_test.go+3 added-1 removed
21 unmodified lines
22 query: query,23 allItems: allItems,24 lastAction: actBackwardDeleteCharEof,25 prompt: "prompt",26 executor: util.NewExecutor(""),27 })28}2930func TestReplacePlaceholder(t *testing.T) {
213 unmodified lines
244 type quotes struct{ E, O, SQ, DQ, BS string } // standalone escape, outer, single and double quotes, backslash245 unixStyle := quotes{``, `'`, `'\''`, `"`, `\`}246 windowsStyle := quotes{`^`, `^"`, `'`, `\^"`, `\\`}247 var effectiveStyle quotes248 exec := util.NewExecutor("")249250 if util.IsWindows() {251 effectiveStyle = windowsStyle252 } else {
26 unmodified lines
279 `"C:\Program Files"`: `{{.O}}{{.DQ}}C:{{.BS}}Program Files{{.DQ}}{{.O}}`,280 }281282 for input, expected := range tests {281 escaped := quoteEntry(input)283 escaped := exec.QuoteEntry(input)284 expected = templateToString(expected, effectiveStyle)285 if escaped != expected {286 t.Errorf("Input: %s, expected: %s, actual %s", input, expected, escaped)287 }
371 unmodified lines
modified:src/terminal_unix.go-19 removed
3 unmodified lines
45import (6 "os"7 "os/signal"8 "strings"8 "syscall"910 "golang.org/x/sys/unix"11)1214var escaper *strings.Replacer1516func init() {17 tokens := strings.Split(os.Getenv("SHELL"), "/")18 if tokens[len(tokens)-1] == "fish" {19 // https://fishshell.com/docs/current/language.html#quotes20 // > The only meaningful escape sequences in single quotes are \', which21 // > escapes a single quote and \\, which escapes the backslash symbol.22 escaper = strings.NewReplacer("\\", "\\\\", "'", "\\'")23 } else {24 escaper = strings.NewReplacer("'", "'\\''")25 }26}2713func notifyOnResize(resizeChan chan<- os.Signal) {14 signal.Notify(resizeChan, syscall.SIGWINCH)15}16
8 unmodified lines
2526func notifyOnCont(resizeChan chan<- os.Signal) {27 signal.Notify(resizeChan, syscall.SIGCONT)28}4445func quoteEntry(entry string) string {46 return "'" + escaper.Replace(entry) + "'"47}
modified:src/terminal_windows.go-26 removed
2 unmodified lines
3package fzf45import (6 "os"7 "regexp"8 "strings"7)89func notifyOnResize(resizeChan chan<- os.Signal) {10 // TODO
5 unmodified lines
1617func notifyOnCont(resizeChan chan<- os.Signal) {18 // NOOP19}2223func quoteEntry(entry string) string {24 shell := os.Getenv("SHELL")25 if len(shell) == 0 {26 shell = "cmd"27 }2829 if strings.Contains(shell, "cmd") {30 // backslash escaping is done here for applications31 // (see ripgrep test case in terminal_test.go#TestWindowsCommands)32 escaped := strings.Replace(entry, `\`, `\\`, -1)33 escaped = `"` + strings.Replace(escaped, `"`, `\"`, -1) + `"`34 // caret is the escape character for cmd shell35 r, _ := regexp.Compile(`[&|<>()@^%!"]`)36 return r.ReplaceAllStringFunc(escaped, func(match string) string {37 return "^" + match38 })39 } else if strings.Contains(shell, "pwsh") || strings.Contains(shell, "powershell") {40 escaped := strings.Replace(entry, `"`, `\"`, -1)41 return "'" + strings.Replace(escaped, "'", "''", -1) + "'"42 } else {43 return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"44 }45}
modified:src/terminal.go+25 added-28 removed
5 unmodified lines
6 "fmt"7 "io"8 "math"9 "os"10 "os/exec"10 "os/signal"11 "regexp"12 "sort"13 "strconv"
229 unmodified lines
243 listenPort *int244 listenUnsafe bool245 borderShape tui.BorderShape246 cleanExit bool247 executor *util.Executor248 paused bool249 border tui.Window250 window tui.Window251 pborder tui.Window
387 unmodified lines
639 return int(size)640}641642// NewTerminal returns new Terminal object643func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {643func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor) *Terminal {644 input := trimQuery(opts.Query)645 var delay time.Duration646 if opts.Tac {647 delay = initialDelayTac
87 unmodified lines
735 borderLabelOpts: opts.BorderLabel,736 previewLabel: nil,737 previewLabelOpts: opts.PreviewLabel,738 cleanExit: opts.ClearOnExit,739 executor: executor,740 paused: opts.Phony,741 cycle: opts.Cycle,742 headerVisible: true,743 headerFirst: opts.HeaderFirst,
1778 unmodified lines
2522 query string2523 allItems []*Item2524 lastAction actionType2525 prompt string2526 executor *util.Executor2527}25282529func (t *Terminal) replacePlaceholder(template string, forcePlus bool, input string, list []*Item) string {2530 return replacePlaceholder(replacePlaceholderParams{
5 unmodified lines
2536 query: input,2537 allItems: list,2538 lastAction: t.lastAction,2539 prompt: t.promptString,2540 executor: t.executor,2541 })2542}25432544func (t *Terminal) evaluateScrollOffset() int {
52 unmodified lines
2597 switch {2598 case escaped:2599 return match2600 case match == "{q}" || match == "{fzf:query}":2598 return quoteEntry(params.query)2601 return params.executor.QuoteEntry(params.query)2602 case match == "{}":2603 replace = func(item *Item) string {2604 switch {2605 case flags.number:
4 unmodified lines
2610 return strconv.Itoa(n)2611 case flags.file:2612 return item.AsString(params.stripAnsi)2613 default:2611 return quoteEntry(item.AsString(params.stripAnsi))2614 return params.executor.QuoteEntry(item.AsString(params.stripAnsi))2615 }2616 }2617 case match == "{fzf:action}":2618 return params.lastAction.Name()2619 case match == "{fzf:prompt}":2617 return quoteEntry(params.prompt)2620 return params.executor.QuoteEntry(params.prompt)2621 default:2622 // token type and also failover (below)2623 rangeExpressions := strings.Split(match[1:len(match)-1], ",")2624 ranges := make([]Range, len(rangeExpressions))
25 unmodified lines
2650 if !flags.preserveSpace {2651 str = strings.TrimSpace(str)2652 }2653 if !flags.file {2651 str = quoteEntry(str)2654 str = params.executor.QuoteEntry(str)2655 }2656 return str2657 }2658 }
31 unmodified lines
2690 if !valid && !capture {2691 return line2692 }2693 command := t.replacePlaceholder(template, forcePlus, string(t.input), list)2691 cmd := util.ExecCommand(command, false)2694 cmd := t.executor.ExecCommand(command, false)2695 cmd.Env = t.environ()2696 t.executing.Set(true)2697 if !background {2698 cmd.Stdin = tui.TtyIn()
268 unmodified lines
2967 // We don't display preview window if no match2968 if items[0] != nil {2969 _, query := t.Input()2970 command := t.replacePlaceholder(commandTemplate, false, string(query), items)2968 cmd := util.ExecCommand(command, true)2971 cmd := t.executor.ExecCommand(command, true)2972 env := t.environ()2973 if pwindowSize.Lines > 0 {2974 lines := fmt.Sprintf("LINES=%d", pwindowSize.Lines)2975 columns := fmt.Sprintf("COLUMNS=%d", pwindowSize.Columns)
398 unmodified lines
3374 case actBecome:3375 valid, list := t.buildPlusList(a.a, false)3376 if valid {3377 command := t.replacePlaceholder(a.a, false, string(t.input), list)3375 shell := os.Getenv("SHELL")3376 if len(shell) == 0 {3377 shell = "sh"3378 t.tui.Close()3379 if t.history != nil {3380 t.history.append(string(t.input))3381 }3379 shellPath, err := exec.LookPath(shell)3380 if err == nil {3381 t.tui.Close()3382 if t.history != nil {3383 t.history.append(string(t.input))3384 }3385 /*3386 FIXME: It is not at all clear why this is required.3387 The following command will report 'not a tty', unless we open3388 /dev/tty *twice* after closing the standard input for 'reload'3389 in Reader.terminate().3390 : | fzf --bind 'start:reload:ls' --bind 'enter:become:tty'3391 */3392 tui.TtyIn()3393 util.SetStdin(tui.TtyIn())3394 syscall.Exec(shellPath, []string{shell, "-c", command}, os.Environ())3395 }33823383 /*3384 FIXME: It is not at all clear why this is required.3385 The following command will report 'not a tty', unless we open3386 /dev/tty *twice* after closing the standard input for 'reload'3387 in Reader.terminate().33883389 while : | fzf --bind 'start:reload:ls' --bind 'load:become:tty'; do echo; done3390 */3391 tui.TtyIn()3392 t.executor.Become(tui.TtyIn(), t.environ(), command)3393 }3394 case actExecute, actExecuteSilent:3395 t.executeCommand(a.a, false, a.t == actExecuteSilent, false, false)3396 case actExecuteMulti:
895 unmodified lines
modified:test/test_go.rb+1 added-1 removed
1972 unmodified lines
1973 tmux.send_keys :Space1974 tmux.until { |lines| assert_equal 10, lines.item_count }1975 end19761977 def test_reload_should_terminate_stadard_input_stream1977 def test_reload_should_terminate_standard_input_stream1978 tmux.send_keys %(ruby -e "STDOUT.sync = true; loop { puts 1; sleep 0.1 }" | fzf --bind 'start:reload(seq 100)'), :Enter1979 tmux.until { |lines| assert_equal 100, lines.item_count }1980 end1981
1791 unmodified lines
modified:CHANGELOG.md+13 added
1 unmodified line
2=========340.51.05------6- Added `--with-shell` option to start child processes with a custom shell command and flags7 ```sh8 gem list | fzf --with-shell 'ruby -e' \9 --preview 'pp Gem::Specification.find_by_name({1})' \10 --bind 'ctrl-o:execute-silent:11 spec = Gem::Specification.find_by_name({1})12 [spec.homepage, *spec.metadata.filter { _1.end_with?("uri") }.values].uniq.each do13 system "open", _114 end15 '16 ```17- Added `change-multi` action for dynamically changing `--multi` option18 - `change-multi` - enable multi-select mode with no limit19 - `change-multi(NUM)` - enable multi-select mode with a limit20 - `change-multi(0)` - disable multi-select mode21- `become` action is now supported on Windows22 - Unlike in *nix, this does not use `execve(2)`. Instead it spawns a new process and waits for it to finish, so the exact behavior may differ.23- Bug fixes and improvements24250.50.026------
2013 unmodified lines