Avoid tty1 black screen on live boot

This commit is contained in:
Mikhail Chusavitin
2026-03-14 08:14:49 +03:00
parent e8e176ab7f
commit 55d6876297
2 changed files with 12 additions and 9 deletions

View File

@@ -65,7 +65,11 @@ type formField struct {
}
func Run(application *app.App, runtimeMode runtimeenv.Mode) error {
program := tea.NewProgram(newModel(application, runtimeMode), tea.WithAltScreen())
options := []tea.ProgramOption{}
if runtimeMode != runtimeenv.ModeLiveCD {
options = append(options, tea.WithAltScreen())
}
program := tea.NewProgram(newModel(application, runtimeMode), options...)
_, err := program.Run()
return err
}

View File

@@ -9,13 +9,12 @@ menu() {
fi
}
# Auto-open TUI on local tty1 after boot.
# Exiting TUI returns to this shell (console prompt).
if [ -z "${BEE_TUI_AUTO_LAUNCHED:-}" ] \
&& [ -z "${SSH_CONNECTION:-}" ] \
# On the local console, keep the shell visible and let the operator
# start the TUI explicitly. This avoids black-screen failures if the
# terminal implementation does not support the TUI well.
if [ -z "${SSH_CONNECTION:-}" ] \
&& [ -z "${SSH_TTY:-}" ] \
&& [ "$(tty 2>/dev/null)" = "/dev/tty1" ] \
&& [ -x /usr/local/bin/bee-tui ]; then
export BEE_TUI_AUTO_LAUNCHED=1
/usr/local/bin/bee-tui
&& [ "$(tty 2>/dev/null)" = "/dev/tty1" ]; then
echo "Bee live environment ready."
echo "Run 'menu' to open the TUI."
fi