You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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, 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.
@cpendery
Currently, bubble tea programs are not supposed to redirect their output results to another file or pipe them to a command. Therefore, for example, if you write bubbles tea's standard output to a file with the current implementation, the file will have ANSI control characters written directly to it.
As shown in the example in /examples/pipe, bubble tea will automatically create a new terminal by opening a new "dev/tty" and input from the terminal if it determines that input is given from a non-terminal source at startup. However, it does not seem to judge whether the output is other than terminal or not at startup. This is why the fmt.Fprint(o.tty, CSI+AltScreenSeq) part of termenv's AltScreen() internal process, which is executed internally, is not interpreted by the terminal and does not result in an alt screen. (Actually, the [?1049 in the escape string you received is a special instruction string to the terminal, representing the command to show alt screen.)
I have no workaround for this problem in bubble tea at this time, and I guess that a new feature needs to be implemented.
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, 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.
To Reproduce
Steps to reproduce the behavior:
$(./fullscreen)
\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
The text was updated successfully, but these errors were encountered: