fix: added scroll hint to message on command output

This commit is contained in:
Hayden Hargreaves 2026-03-30 22:37:02 -07:00
parent 402c93db50
commit 1e2f1b147b
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
) )
const CommandOutputExitMessage = "Press ENTER to continue" const CommandOutputExitMessage = "Press ENTER to continue"
const CommandOutputScrollMessage = "Use j/k to scroll"
type CommandOutput struct { type CommandOutput struct {
Title string Title string

View File

@ -341,7 +341,11 @@ func overlayCommandOutputWindow(view string, cmd *core.CommandOutput, styles sty
content := styles.LineStyle.Render(strings.ReplaceAll(l, "\n", "\\n")) content := styles.LineStyle.Render(strings.ReplaceAll(l, "\n", "\\n"))
overlay = append(overlay, content) 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(), // 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. // which would cause Lipgloss to embed newlines internally and corrupt the line count.