Skip to content

Commit

Permalink
fix: raw output being rendered twice (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Sep 11, 2024
1 parent 17538ff commit 40a0456
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ var (
RunE: func(cmd *cobra.Command, args []string) error {
config.Prefix = removeWhitespace(strings.Join(args, " "))

opts := []tea.ProgramOption{
tea.WithOutput(os.Stderr),
}
opts := []tea.ProgramOption{}

if !isInputTTY() {
if !isInputTTY() || config.Raw {
opts = append(opts, tea.WithInput(nil))
}
if !isOutputTTY() {
if isOutputTTY() && !config.Raw {
opts = append(opts, tea.WithOutput(os.Stderr))
} else {
opts = append(opts, tea.WithoutRenderer())
}
if os.Getenv("VIMRUNTIME") != "" {
Expand Down
2 changes: 1 addition & 1 deletion mods.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (m *Mods) View() string {
return m.glamOutput
}

if isOutputTTY() {
if isOutputTTY() && !m.Config.Raw {
return m.Output
}

Expand Down

0 comments on commit 40a0456

Please sign in to comment.