package commandctrl import ( "context" tea "github.com/charmbracelet/bubbletea" ) type commandCtlKeyType struct{} var commandCtlKey = commandCtlKeyType{} func PostMsg(ctx context.Context, msg tea.Msg) { cmdCtl, ok := ctx.Value(commandCtlKey).(*CommandController) if ok { cmdCtl.postMessage(msg) } }