github charmbracelet/wish v1.3.0

latest releases: v1.4.3, v1.4.2, v1.4.1...
7 months ago

PTYs, Subsystems, and More

This release is loaded with improvements and new features like support for exec, server banners, subsystems, and client color profiles. Read on for more!

Exec and PTYs

At last, now you can get real a PTY for reach SSH connection. This allows you to exec.Command on the remote. This also means bubbletea.Exec will now work as expected1!

// Open a file in Vim in Bubble Tea (on the server)
c := wish.Command(m.sess, "vim", "file.txt")
cmd := tea.Exec(c, func(err error) tea.Msg {
  if err != nil {
    log.Error("vim finished", "error", err)
  }
  return cmdFinishedMsg{err: err}
})

Example

Lip Gloss Renderers

You can now use MakeRenderer to create a Lip Gloss renderer for the each user's session. This will suss out the user's terminal and render colors using the best available color profile as well as detect whether the background is dark or light. You can then use that renderer to init your app's styles.

Before this update, it would use the server's environment variables to figure this out, which could cause wrong results, especially when running via Docker/Systemd.

The behavior of MiddlewareWithColorProfile has also changed: now, the provided color profile will be used as "the minimal color profile supported".

Example

Server Banners

Time to fire up figlet: server banners are here! Enjoy! 🫶

Example

Subsystems

You can now use the WithSubsystem option to add handlers for specific subsystems (for instance, SFTP).

Example

Git Improvements

If you ever wanted to use Wish's private ensureRepo function, you'll be happy to know it is now public (i.e. EnsureRepo). Ensure repo creates Git repos on demand.

Go 1.19

Wish now requires Go 1.19 to run.

Docs

We added new examples in the examples directory, as well as updated many of the previously existing ones.
Check them out to learn more about Wish. 😬


Changelog

New Features

Bug fixes

Dependency updates

Documentation updates

Other work


The Charm logo

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

Footnotes

  1. Windows support is limited, see charmbracelet/ssh#20 and #232. ↩

Don't miss a new wish release

NewReleases is sending notifications on new releases.