Skip to content

Conversation

@phanen
Copy link
Contributor

@phanen phanen commented Oct 24, 2025

Since all other infoStyle has spinner, maybe also add spinner for --info=inline.

diff --git a/src/terminal.go b/src/terminal.go
index add51919..b4006ebd 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -2978,6 +2978,10 @@ func (t *Terminal) printInfoImpl() {
 	if outputPrinter == nil {
 		output = t.trimMessage(output, maxWidth)
 		t.window.CPrint(tui.ColInfo, output)
+		if t.infoStyle == infoInline {
+			t.window.Print(" ")
+			printSpinner()
+		}
 	} else {
 		outputPrinter(t.window, maxWidth)
 	}

@phanen
Copy link
Contributor Author

phanen commented Oct 24, 2025

Not sure if $FZF_SPINNER should be exported (#4344 (comment)). Or just export idx of spinner, so user can use their custom one.

diff --git a/src/terminal.go b/src/terminal.go
index b4006ebd..88c72d2e 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -1300,6 +1300,9 @@ func (t *Terminal) environImpl(forPreview bool) []string {
 		env = append(env, fmt.Sprintf("FZF_PORT=%d", *t.listenPort))
 	}
 	env = append(env, "FZF_QUERY="+string(t.input))
+	duration := int64(spinnerDuration)
+	idx := (time.Now().UnixNano() % (duration * int64(len(t.spinner)))) / duration
+	env = append(env, "FZF_SPINNER="+string(t.spinner[idx]))
 	env = append(env, "FZF_ACTION="+t.lastAction.Name())
 	env = append(env, "FZF_KEY="+t.lastKey)
 	env = append(env, "FZF_PROMPT="+string(t.promptString))

Test:
  go run main.go --query "$(seq 100)" --info inline --border < <(sleep 60)
@junegunn
Copy link
Owner

Not sure if $FZF_SPINNER should be exported (#4344 (comment)). Or just export idx of spinner, so user can use their custom one.

I'd hold off on the decision until someone actually asks for it (seems unlikely).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants