@@ -381,6 +381,7 @@ type Terminal struct {
381381 slab * util.Slab
382382 theme * tui.ColorTheme
383383 tui tui.Renderer
384+ ttyDefault string
384385 ttyin * os.File
385386 executing * util.AtomicBool
386387 termSize tui.TermSize
@@ -809,15 +810,15 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
809810 // when you run fzf multiple times in your Go program. Closing it is known to
810811 // cause problems with 'become' action and invalid terminal state after exit.
811812 if ttyin == nil {
812- if ttyin , err = tui .TtyIn (); err != nil {
813+ if ttyin , err = tui .TtyIn (opts . TtyDefault ); err != nil {
813814 return nil , err
814815 }
815816 }
816817 if fullscreen {
817818 if tui .HasFullscreenRenderer () {
818819 renderer = tui .NewFullscreenRenderer (opts .Theme , opts .Black , opts .Mouse )
819820 } else {
820- renderer , err = tui .NewLightRenderer (ttyin , opts .Theme , opts .Black , opts .Mouse , opts .Tabstop , opts .ClearOnExit ,
821+ renderer , err = tui .NewLightRenderer (opts . TtyDefault , ttyin , opts .Theme , opts .Black , opts .Mouse , opts .Tabstop , opts .ClearOnExit ,
821822 true , func (h int ) int { return h })
822823 }
823824 } else {
@@ -833,7 +834,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
833834 effectiveMinHeight += borderLines (opts .BorderShape )
834835 return util .Min (termHeight , util .Max (evaluateHeight (opts , termHeight ), effectiveMinHeight ))
835836 }
836- renderer , err = tui .NewLightRenderer (ttyin , opts .Theme , opts .Black , opts .Mouse , opts .Tabstop , opts .ClearOnExit , false , maxHeightFunc )
837+ renderer , err = tui .NewLightRenderer (opts . TtyDefault , ttyin , opts .Theme , opts .Black , opts .Mouse , opts .Tabstop , opts .ClearOnExit , false , maxHeightFunc )
837838 }
838839 if err != nil {
839840 return nil , err
@@ -967,6 +968,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
967968 keyChan : make (chan tui.Event ),
968969 eventChan : make (chan tui.Event , 6 ), // start | (load + result + zero|one) | (focus) | (resize)
969970 tui : renderer ,
971+ ttyDefault : opts .TtyDefault ,
970972 ttyin : ttyin ,
971973 initFunc : func () error { return renderer .Init () },
972974 executing : util .NewAtomicBool (false ),
@@ -4042,7 +4044,7 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
40424044 t .executing .Set (true )
40434045 if ! background {
40444046 // Open a separate handle for tty input
4045- if in , _ := tui .TtyIn (); in != nil {
4047+ if in , _ := tui .TtyIn (t . ttyDefault ); in != nil {
40464048 cmd .Stdin = in
40474049 if in != os .Stdin {
40484050 defer in .Close ()
@@ -4051,15 +4053,15 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
40514053
40524054 cmd .Stdout = os .Stdout
40534055 if ! util .IsTty (os .Stdout ) {
4054- if out , _ := tui .TtyOut (); out != nil {
4056+ if out , _ := tui .TtyOut (t . ttyDefault ); out != nil {
40554057 cmd .Stdout = out
40564058 defer out .Close ()
40574059 }
40584060 }
40594061
40604062 cmd .Stderr = os .Stderr
40614063 if ! util .IsTty (os .Stderr ) {
4062- if out , _ := tui .TtyOut (); out != nil {
4064+ if out , _ := tui .TtyOut (t . ttyDefault ); out != nil {
40634065 cmd .Stderr = out
40644066 defer out .Close ()
40654067 }
0 commit comments