From 1e2f1b147bf83d9458271d7758e9bcf1e60cd736 Mon Sep 17 00:00:00 2001 From: Hayden Hargreaves Date: Mon, 30 Mar 2026 22:37:02 -0700 Subject: [PATCH] fix: added scroll hint to message on command output --- internal/core/command.go | 1 + internal/editor/view.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/core/command.go b/internal/core/command.go index ed989df..e56a2d9 100644 --- a/internal/core/command.go +++ b/internal/core/command.go @@ -5,6 +5,7 @@ import ( ) const CommandOutputExitMessage = "Press ENTER to continue" +const CommandOutputScrollMessage = "Use j/k to scroll" type CommandOutput struct { Title string diff --git a/internal/editor/view.go b/internal/editor/view.go index 144b7ba..b4caeee 100644 --- a/internal/editor/view.go +++ b/internal/editor/view.go @@ -341,7 +341,11 @@ func overlayCommandOutputWindow(view string, cmd *core.CommandOutput, styles sty content := styles.LineStyle.Render(strings.ReplaceAll(l, "\n", "\\n")) overlay = append(overlay, content) } - overlay = append(overlay, styles.CommandContinueMessage.Render(core.CommandOutputExitMessage)) + msg := core.CommandOutputExitMessage + if len(cmd.Lines) > len(cmd.Viewport(termHeight)) { + msg += ". " + core.CommandOutputScrollMessage + } + overlay = append(overlay, styles.CommandContinueMessage.Render(msg)) // NOTE: strings.Split on "\n" is safe as long as no style uses .Width()/.Height()/.Padding()/.Margin(), // which would cause Lipgloss to embed newlines internally and corrupt the line count.