MCPcopy
hub / github.com/docker/docker-agent / formatWindowTitle

Function formatWindowTitle

pkg/tui/tui.go:2655–2664  ·  view source on GitHub ↗

formatWindowTitle assembles the terminal window title string from the individual inputs that contribute to it. Pure function — extracted from the windowTitle method so that it can be unit-tested without constructing a full appModel.

(appName, sessionTitle string, working bool, animFrame int)

Source from the content-addressed store, hash-verified

2653// windowTitle method so that it can be unit-tested without constructing a
2654// full appModel.
2655func formatWindowTitle(appName, sessionTitle string, working bool, animFrame int) string {
2656 title := appName
2657 if sessionTitle != "" {
2658 title = sessionTitle + " - " + appName
2659 }
2660 if working {
2661 title = spinner.Frame(animFrame) + " " + title
2662 }
2663 return title
2664}
2665
2666// defaultExitFunc is the process-exit function used by the shutdown safety
2667// net when the graceful exit times out. It is a package var (not a const)

Callers 2

TestFormatWindowTitleFunction · 0.85
windowTitleMethod · 0.85

Calls 1

FrameFunction · 0.92

Tested by 1

TestFormatWindowTitleFunction · 0.68