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.