MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / WaitForEnterToReturn

Function WaitForEnterToReturn

internal/ui/utils/input.go:49–64  ·  view source on GitHub ↗

WaitForEnterToReturn displays a status message and waits for the user to press Enter before returning to the TUI. This provides a consistent experience across all suspend/resume operations.

(err error, successMsg, failureMsg string)

Source from the content-addressed store, hash-verified

47// before returning to the TUI. This provides a consistent experience across all
48// suspend/resume operations.
49func WaitForEnterToReturn(err error, successMsg, failureMsg string) {
50 // Show completion status
51 if err != nil {
52 fmt.Printf("\n%s\n", display.IconText("❌", fmt.Sprintf("%s: %v", failureMsg, err), showIcons.Load()))
53 } else {
54 fmt.Printf("\n%s\n", display.IconText("✅", successMsg, showIcons.Load()))
55 }
56
57 fmt.Print("\nPress Enter to return to the TUI...")
58
59 if _, err := fmt.Scanln(); err != nil {
60 // Ignore scan errors as they're not critical for this function
61 // The user might have pressed Ctrl+C or similar
62 _ = err // Explicitly ignore the error to avoid empty branch
63 }
64}

Callers 5

ExecuteNodeShellWithFunction · 0.92
ExecuteLXCShellWithFunction · 0.92
ExecuteQemuShellWithFunction · 0.92
InstallScriptFunction · 0.92
InstallScriptInLXCFunction · 0.92

Calls 1

IconTextFunction · 0.92

Tested by

no test coverage detected