Skip to content

Commit

Permalink
Update commands.go
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Rocha <christian@rocha.is>
  • Loading branch information
aymanbagabas and meowgorithm committed Apr 24, 2024
1 parent bce9727 commit cf5a21a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commands.go
Expand Up @@ -194,7 +194,11 @@ func SetWindowTitle(title string) Cmd {

type windowSizeMsg struct{}

// WindowSize is a command that queries the terminal for its current size.
// WindowSize is a command that queries the terminal for its current size. It
// delivers the results to Update via a [WindowSizeMsg]. Keep in mind that
// WindowSizeMsgs will automatically be delivered to Update when the [Program]
// starts and when the window dimensions change so in many cases you will not
// need to explicitly invoke this command.
func WindowSize() Cmd {
return func() Msg {
return windowSizeMsg{}
Expand Down

0 comments on commit cf5a21a

Please sign in to comment.