charmbracelet / charmbracelet/bubbletea
bubbletea's alt screen isn't triggering when run as a bash subcommand
- Dominant language
- Go
- Stars
- 44.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I'm trying to run a bubbletea app as a bash subcommand where all the UI gets sent to an alt window that the user interacts with and when the app closes I can write some data to stdout and capture it. Basically the script would look like `output=$(./fullscreen)`. When I try this with the [fullscreen example](https://github.com/charmbracelet/bubbletea/tree/master/examples/fullscreen), it just hangs for 5 seconds without displaying the alt screen. Is this possible to do with bubbletea's implementation? I know it can be done with tcell, and I'm getting back the escape code `\E[?25l\E[?1049h\E[2J\E[1;1H\E[1;1H\E[?25l\r`.
**Setup**
Please complete the following information along with version numbers, if applicable.
- OS: windows
- Shell: bash
- Terminal Emulator: git bash
**To Reproduce**
Steps to reproduce the behavior:
1. Build the [fullscreen example](https://github.com/charmbracelet/bubbletea/tree/master/examples/fullscreen)
2. Run `$(./fullscreen)`
3. Observe that the UI isn't shown
4. Receive error after 5 seconds about escape string `\E[?25l\E[?1049h\E[2J\E[1;1H\E[1;1H\E[?25l\r`
**Source Code**
N/A
**Expected behavior**
I'd think the alternate screen would show for the 5 seconds and then the command would terminate
**Screenshots**
N/A
**Additional context**
N/A
Contributor guide
Research direction
Start with the fullscreen example linked in the issue and reproduce `$(./fullscreen)` under Windows Git Bash. Compare its behavior with the reported escape sequence and five-second timeout; done means establishing whether alternate-screen output can work in this command-substitution setup and documenting or validating the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100