From a4391aeedd4fec1865d2d646711f58d04058531b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 27 Apr 2024 18:36:37 +0900 Subject: Add --with-shell for shelling out with different command and flags (#3746) Close #3732 --- src/core.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core.go') diff --git a/src/core.go b/src/core.go index ec137698..14aa781f 100644 --- a/src/core.go +++ b/src/core.go @@ -121,13 +121,16 @@ func Run(opts *Options, version string, revision string) { }) } + // Process executor + executor := util.NewExecutor(opts.WithShell) + // Reader streamingFilter := opts.Filter != nil && !sort && !opts.Tac && !opts.Sync var reader *Reader if !streamingFilter { reader = NewReader(func(data []byte) bool { return chunkList.Push(data) - }, eventBox, opts.ReadZero, opts.Filter == nil) + }, eventBox, executor, opts.ReadZero, opts.Filter == nil) go reader.ReadSource(opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip) } @@ -178,7 +181,7 @@ func Run(opts *Options, version string, revision string) { mutex.Unlock() } return false - }, eventBox, opts.ReadZero, false) + }, eventBox, executor, opts.ReadZero, false) reader.ReadSource(opts.WalkerRoot, opts.WalkerOpts, opts.WalkerSkip) } else { eventBox.Unwatch(EvtReadNew) @@ -209,7 +212,7 @@ func Run(opts *Options, version string, revision string) { go matcher.Loop() // Terminal I/O - terminal := NewTerminal(opts, eventBox) + terminal := NewTerminal(opts, eventBox, executor) maxFit := 0 // Maximum number of items that can fit on screen padHeight := 0 heightUnknown := opts.Height.auto -- cgit v1.2.3