Giter Site home page Giter Site logo

terminal's Introduction

Code Status Build Status Coverage Status Join us on Slack

Fyne Terminal

A terminal emulator using the Fyne toolkit, supports Linux, macOS, Windows and BSD.

Running on Linux with a custom zsh theme. screenshot

Running on macOS with a powerlevel10k zsh theme and classic style. screenshot

Running on Windows with PowerShell running inside. screenshot

Installing on command line

Just use the go get command (you'll need a Go and C compiler installed first):

go get github.com/fyne-io/terminal/cmd/fyneterm

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
  • Windows support
  • Copy and Paste

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 (macOS and Linux) or connecting to a remote shell.

Local Shell

To load a terminal widget and launch the current shell (works on macOS and Linux) use the RunLocalShell method after creating a Terminal, as follows:

	// win is a fyne.Window created to hold the content
	t := terminal.New()
	w.SetContent(t)

	go func() {
		_ = t.RunLocalShell()
		a.Quit()
	}()
	w.ShowAndRun()

Remote connection

For example to open a terminal to an SSH connection that you have created:

	// session is an *ssh.Session from golang.org/x/crypto/ssh
	// win is a fyne.Window created to hold the content
	in, _ := session.StdinPipe()
	out, _ := session.StdoutPipe()

	go session.Run("$SHELL || bash")

	t := terminal.New()
	w.SetContent(t)

	go func() {
		_ = t.RunWithConnection(in, out)
		a.Quit()
	}()
	w.ShowAndRun()

terminal's People

Contributors

andydotxyz avatar dependabot[bot] avatar jacalz avatar mgazza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.