Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fyne-io/terminal
A graphical terminal emulator for Linux using Fyne
https://github.com/fyne-io/terminal
cross-platform fyne go golang hacktoberfest
Last synced: 1 day ago
JSON representation
A graphical terminal emulator for Linux using Fyne
- Host: GitHub
- URL: https://github.com/fyne-io/terminal
- Owner: fyne-io
- License: other
- Created: 2020-02-23T22:56:26.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-09T10:17:16.000Z (10 days ago)
- Last Synced: 2025-02-10T07:04:07.360Z (9 days ago)
- Topics: cross-platform, fyne, go, golang, hacktoberfest
- Language: Go
- Homepage:
- Size: 13.1 MB
- Stars: 263
- Watchers: 10
- Forks: 41
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-terminals - Fyne Terminal - A graphical terminal emulator for Linux using Fyne (Uncategorized / Uncategorized)
README
# Fyne Terminal
A terminal emulator using the Fyne toolkit, supports Linux, macOS, Windows and BSD.
Running on Linux with a custom zsh theme.
Running on macOS with a powerlevel10k zsh theme and classic style.
Running on Windows with PowerShell running inside.
# Installing on command line
Just use the go get command (you'll need a Go and C compiler installed first):
```
go install github.com/fyne-io/terminal/cmd/fyneterm@latest
```# Installing as an app
To get the app installed alongside your other applications (with metadata, icons etc),
use the `fyne` tool, as illustrated below:```
$ go get fyne.io/fyne/v2/cmd/fyne
$ fyne get github.com/fyne-io/terminal/cmd/fyneterm
```# TODO
There are lots of great things that could be added to this app.
Already planned is:* Tabs
* Scroll-back
* Background and font/size customisation
* Split panels# Library
You can also use this project as a library to create your own
terminal based applications, using the import path "github.com/fyne-io/terminal".There are two modes, using the default shell or connecting to a remote shell.
## Local Shell
To load a terminal widget and launch the current shell (works on macOS and Linux;
on Windows, it always uses PowerShell) use the `RunLocalShell` method after creating
a `Terminal`, as follows:```go
// run new terminal and close app on terminal exit.
t := terminal.New()
go func() {
_ = t.RunLocalShell()
log.Printf("Terminal's shell exited with exit code: %d", t.ExitCode())
a.Quit()
}()// w is a fyne.Window created to hold the content
w.SetContent(t)
w.ShowAndRun()
```## Remote connection
For example to open a terminal to an SSH connection that you have created:
```go
// session is an *ssh.Session from golang.org/x/crypto/ssh
in, _ := session.StdinPipe()
out, _ := session.StdoutPipe()
go session.Run("$SHELL || bash")// run new terminal and close app on terminal exit.
t := terminal.New()
go func() {
_ = t.RunWithConnection(in, out)
a.Quit()
}()// OPTIONAL: dynamically resize the terminal session
ch := make(chan terminal.Config)
go func() {
rows, cols := uint(0), uint(0)
for {
config := <-ch
if rows == config.Rows && cols == config.Columns {
continue
}
rows, cols = config.Rows, config.Columns
session.WindowChange(int(rows), int(cols))
}
}()
t.AddListener(ch)// w is a fyne.Window created to hold the content
w.SetContent(t)
w.ShowAndRun()
```