diff --git a/commander.go b/commander.go index 9d9b6f6..0f718cd 100644 --- a/commander.go +++ b/commander.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "os" "os/exec" "runtime" ) @@ -27,12 +26,9 @@ func isInstalled(name string) bool { func subExecute(program string, args ...string) ([]byte, error) { cmd := exec.Command(program, args...) - cmd.Stdin = os.Stdin - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - err := cmd.Run() + output, err := cmd.CombinedOutput() if err != nil { fmt.Printf("%v\n", err) } - return cmd.CombinedOutput() + return output, err } diff --git a/internal/ui/ui.go b/internal/ui/ui.go index d680fe5..49b9147 100644 --- a/internal/ui/ui.go +++ b/internal/ui/ui.go @@ -480,7 +480,7 @@ func (a *App) renderPlayback() string { Padding(1, 2). Width(boxW) - dispW := min(boxW-10, 50) // leave room for vertical vol bar (~2) + separator + dispW := min(boxW-11, 50) // leave room for vertical vol bar (2) + slightly larger gap (2) display := lipgloss.NewStyle(). Background(lipgloss.Color("235")). Foreground(lipgloss.Color("46")). // classic green lcd @@ -504,11 +504,12 @@ func (a *App) renderPlayback() string { metadata := display.Render(strings.Join(metaLines, "\n")) - // vertical volume bar to the right of the metadata display - volBar := renderVolumeBar(a.currentVolume, 5, 2) + // vertical volume bar to the right of the metadata display, matching its exact height + barHeight := lipgloss.Height(metadata) + volBar := renderVolumeBar(a.currentVolume, barHeight, 2) - // place side-by-side (top aligned). Add a small separator space. - viewer := lipgloss.JoinHorizontal(lipgloss.Top, metadata, " ", volBar) + // place side-by-side (top aligned). Slightly increased gap. + viewer := lipgloss.JoinHorizontal(lipgloss.Top, metadata, " ", volBar) // button row (text buttons, stateful) playBtn := "[ > ]" @@ -544,7 +545,7 @@ func min(a, b int) int { } // renderVolumeBar draws a vertical volume indicator bar. -// height matches the metadata display (e.g. 5). +// height is passed in to exactly match the metadata window's rendered height. // background is dark gray ("236"), filled indicator uses the green ("46") from the lcd display. func renderVolumeBar(vol int, height, width int) string { if height <= 0 {