Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bg query workaround causes unwanted output #1145

Closed
rsteube opened this issue Sep 14, 2024 · 5 comments
Closed

bg query workaround causes unwanted output #1145

rsteube opened this issue Sep 14, 2024 · 5 comments

Comments

@rsteube
Copy link

rsteube commented Sep 14, 2024

Describe the bug

The bg query added as workaround in #1107 causes unwanted output when no tea application is started and output is redirected to /dev/stdout.

Setup

  • OS [e.g. Ubuntu, macOS]
    linux
  • Shell [e.g. zsh, fish]
    bash
  • Terminal Emulator [e.g. kitty, iterm]
    foot
  • Terminal Multiplexer [e.g. tmux]
    none

To Reproduce

go run . >/dev/stdout

Source Code

package main

import (
	_ "github.com/charmbracelet/bubbletea"
)

func main() {}

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

bsh ❯ go run . >/dev/stdout
Documents/development/moep via 🐹 v1.23.0 
bsh ❯ 11;rgb:0000/0000/0000R

Additional context

@meowgorithm
Copy link
Member

meowgorithm commented Sep 14, 2024

Oof, thanks for the report, @rsteube. We’ll prioritize this one.

Also—one of the primary reasons for a v2 is to eliminate this situation entirely.

@caarlos0
Copy link
Member

@aymanbagabas does v2 fixes this ?

@rsteube
Copy link
Author

rsteube commented Jan 28, 2025

Ah, yes. I think I still had to patch it for alpha.1 (tab-dance@7502ab8).
But I'm now on alpha.2 without that.

Still got this nasty bit in the code though:

	case tea.KeyMsg:
		switch msg.String() {
		case "ctrl+c", "esc":
			return m, tea.Quit
		case "alt+]", "alt+\\", "10;rgb:ffff/ffff/ffff", "11;rgb:0000/0000/0000": // TODO
			return m, nil
		}

Don't think it's necessary anymore, but gotta check (didn't have the time to work on this for a while).

@rsteube
Copy link
Author

rsteube commented Jan 28, 2025

Yeah, i think it's fine to close this now. Seems to work.

@meowgorithm
Copy link
Member

Sounds good! Yeah, we've completely solved this in v2 and you shouldn't need that anymore. Sorry for the inconvenience, Ralf!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants