Update module github.com/charmbracelet/bubbletea to v0.27.1 #52

Open
abs3nt wants to merge 1 commits from renovate/github.com-charmbracelet-bubbletea-0.x into main
Owner

This PR contains the following updates:

Package Type Update Change
github.com/charmbracelet/bubbletea require minor v0.26.6 -> v0.27.1

Release Notes

charmbracelet/bubbletea (github.com/charmbracelet/bubbletea)

v0.27.1

Compare Source

This is a lil’ workaround for a hang that can occur when starting a program using Lip Gloss. For details see https://github.com/charmbracelet/bubbletea/pull/1107.

Changelog

Bug fixes

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.27.0

Compare Source

Suspending, environment hacking, and more

Hi! This release has three nice little features and some bug fixes. Let's take a look:

Suspending and resuming

At last, now you can programmatically suspend and resume programs with the tea.Suspend command and handle resumes with the tea.ResumeMsg message:

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	switch msg := msg.(type) {

	// Suspend with ctrl+z!
	case tea.KeyMsg:
		switch msg.String() {
		case "ctrl+z":
			m.suspended = true
			return m, tea.Suspend
		}

	// Handle resumes
	case tea.ResumeMsg:
		m.suspended = false
		return m, nil
	}

	// ...
}

Example

There's also a tea.SuspendMsg that flows through Update on suspension.

Special thanks to @​knz for prototyping the original implementation of this.

Setting the environment

When Bubble Tea is behind Wish you may have needed to pass environment variables from the remote session to the Program. Now you can with the all new tea.WithEnvironment:

var sess ssh.Session // ssh.Session is a type from the github.com/charmbracelet/ssh package
pty, _, _ := sess.Pty()
environ := append(sess.Environ(), "TERM="+pty.Term)
p := tea.NewProgram(model, tea.WithEnvironment(environ)

Requesting the window dimensions

All the Bubble Tea pros know that you get a tea.WindowSizeMsg when the Program starts and when the window resizes. Now you can just query it on demand too with the tea.WindowSize command.

Changelog

New!
Fixed

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) | require | minor | `v0.26.6` -> `v0.27.1` | --- ### Release Notes <details> <summary>charmbracelet/bubbletea (github.com/charmbracelet/bubbletea)</summary> ### [`v0.27.1`](https://github.com/charmbracelet/bubbletea/releases/tag/v0.27.1) [Compare Source](https://github.com/charmbracelet/bubbletea/compare/v0.27.0...v0.27.1) This is a lil’ workaround for a hang that can occur when starting a program using Lip Gloss. For details see https://github.com/charmbracelet/bubbletea/pull/1107. #### Changelog ##### Bug fixes - [`d6458e0`](https://github.com/charmbracelet/bubbletea/commit/d6458e03f27245a597a30234a532ef345af31d36): fix: force query the terminal bg before running any programs ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) *** <a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a> Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@&#8203;charm), or on [Discord](https://charm.sh/chat). ### [`v0.27.0`](https://github.com/charmbracelet/bubbletea/releases/tag/v0.27.0) [Compare Source](https://github.com/charmbracelet/bubbletea/compare/v0.26.6...v0.27.0) ### Suspending, environment hacking, and more Hi! This release has three nice little features and some bug fixes. Let's take a look: #### Suspending and resuming At last, now you can programmatically suspend and resume programs with the [`tea.Suspend`](https://pkg.go.dev/github.com/charmbracelet/bubbletea#Suspend) command and handle resumes with the [`tea.ResumeMsg`](https://pkg.go.dev/github.com/charmbracelet/bubbletea#ResumeMsg) message: ```go func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { // Suspend with ctrl+z! case tea.KeyMsg: switch msg.String() { case "ctrl+z": m.suspended = true return m, tea.Suspend } // Handle resumes case tea.ResumeMsg: m.suspended = false return m, nil } // ... } ``` [Example](https://github.com/charmbracelet/bubbletea/blob/d6a19f0eb5a983610bd65a1647f5955abe3ee69e/examples/suspend/main.go) There's also a [`tea.SuspendMsg`](https://pkg.go.dev/github.com/charmbracelet/bubbletea#SuspendMsg) that flows through `Update` on suspension. Special thanks to [@&#8203;knz](https://github.com/knz) for prototyping the original implementation of this. #### Setting the environment When Bubble Tea is behind [Wish](https://github.com/charmbracelet/wish) you may have needed to pass environment variables from the remote session to the `Program`. Now you can with the all new [tea.WithEnvironment](https://pkg.go.dev/github.com/charmbracelet/bubbletea#WithEnvironment): ```go var sess ssh.Session // ssh.Session is a type from the github.com/charmbracelet/ssh package pty, _, _ := sess.Pty() environ := append(sess.Environ(), "TERM="+pty.Term) p := tea.NewProgram(model, tea.WithEnvironment(environ) ``` #### Requesting the window dimensions All the Bubble Tea pros know that you get a `tea.WindowSizeMsg` when the `Program` starts and when the window resizes. Now you can just query it on demand too with the [`tea.WindowSize`](https://pkg.go.dev/github.com/charmbracelet/bubbletea#WindowSize) command. #### Changelog ##### New! - [`7d70838`](https://github.com/charmbracelet/bubbletea/commit/7d708384a105005dfbcec2290bfe4ea1d0e8d9f0): feat: add a cmd to request window size ([#&#8203;988](https://github.com/charmbracelet/bubbletea/issues/988)) ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) - [`ea13ffb`](https://github.com/charmbracelet/bubbletea/commit/ea13ffb9a18d0925491eeb580c66b4c6b2f4284f): feat: allow to suspend bubbletea programs ([#&#8203;1054](https://github.com/charmbracelet/bubbletea/issues/1054)) ([@&#8203;caarlos0](https://github.com/caarlos0)) - [`cae9acd`](https://github.com/charmbracelet/bubbletea/commit/cae9acdf7b37b5723078bae2eaa99ca14c6bcd05): feat: set the program environment variables ([#&#8203;1063](https://github.com/charmbracelet/bubbletea/issues/1063)) ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) ##### Fixed - [`7c1bfc0`](https://github.com/charmbracelet/bubbletea/commit/7c1bfc0e55e65bc6d52ec1e126d97ee45ddbeb08): query window-size in a goroutine ([#&#8203;1059](https://github.com/charmbracelet/bubbletea/issues/1059)) ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) - [`4497aa9`](https://github.com/charmbracelet/bubbletea/commit/4497aa9eef1ce78044d016782e9301dcb1b7c288): reset cursor position on renderer exit ([#&#8203;1058](https://github.com/charmbracelet/bubbletea/issues/1058)) ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) - [`d6a19f0`](https://github.com/charmbracelet/bubbletea/commit/d6a19f0eb5a983610bd65a1647f5955abe3ee69e): wrap `ErrProgramKilled` error ([@&#8203;aymanbagabas](https://github.com/aymanbagabas)) - [`4a9620e`](https://github.com/charmbracelet/bubbletea/commit/4a9620e7134978771059ff7b481b6c9a8c611ac3): fix bugs in package-manager example ([@&#8203;AkshayKalose](https://github.com/AkshayKalose)) *** <a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a> Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@&#8203;charm), or on [Discord](https://charm.sh/chat). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS40OS4wIiwidXBkYXRlZEluVmVyIjoiMzkuNDkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
abs3nt added 1 commit 2024-12-05 11:48:21 +00:00
Author
Owner

ℹ Artifact update notice

File name: go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 3 additional dependencies were updated

Details:

Package Change
github.com/charmbracelet/lipgloss v0.12.1 -> v0.13.0
golang.org/x/sync v0.7.0 -> v0.8.0
golang.org/x/sys v0.22.0 -> v0.24.0
### ℹ Artifact update notice ##### File name: go.mod In order to perform the update(s) described in the table above, Renovate ran the `go get` command, which resulted in the following additional change(s): - 3 additional dependencies were updated Details: | **Package** | **Change** | | :---------------------------------- | :--------------------- | | `github.com/charmbracelet/lipgloss` | `v0.12.1` -> `v0.13.0` | | `golang.org/x/sync` | `v0.7.0` -> `v0.8.0` | | `golang.org/x/sys` | `v0.22.0` -> `v0.24.0` |
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/github.com-charmbracelet-bubbletea-0.x:renovate/github.com-charmbracelet-bubbletea-0.x
git checkout renovate/github.com-charmbracelet-bubbletea-0.x
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: abs3nt/gospt#52
No description provided.