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 { 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() _, err := program.Run()
return err return err
} }

View File

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