Git Product home page Git Product logo

libterm's Introduction

LibTerm

LibTerm is a terminal for iOS with Python 3.7 and Lua 5.3.

Download on the App Store

This app is like @louisdh - OpenTerm but this terminal is embeddable in your own app and it supports Lua and Python 3.7.

Motivation

I like a lot OpenTerm but I wanted to make the code better. Also, I wanted to integrate a local shell into Pisth so I made the project embeddable. I will upload to app to the App Store soon since OpenTerm is no more available. This is not a fork from OpenTerm, I rewrote the code.

Features

The app supports most of OpenTerm features, but LibTerm has Python 3.7 instead of Cub. It supports opening directories outside the sandbox with UIDocumentPickerViewController, multi tabbing and suggestions. Errors are shown in red!

package

LibTerm contains a package command. With package, you can download and install third party commands. You can publish your own commands by submitting a Pull Request to https://github.com/ColdGrub1384/LibTerm-Packages.

Building

  1. $ ./setup.sh
  2. Build LibTerm or LibTermCore target from LibTerm.xcodeproj

Embedding

LibTerm is embeddable so you can use it in your own app. To do it, download releases and embed all frameworks in your app. Then, you can present a LTTerminalViewController. You can also compile the LibTermCore framework and embed it in your app. You will need to embed InputAssistant and ios_system also. You also have to include commandDictionary.plist and extraCommandsDictionary.plist to your app's bundle.

Usage

Instantiating the terminal

LTTerminalViewController.makeTerminal(preferences: <#LTTerminalViewController.Preferences#>, shell: <#LibShell#>)

Accessing the Text view

LTTerminalViewController.terminalTextView

Extending

You can add a command by subclassing LibShell:

func python3_main(argc: Int, argv: [String], io: LTIO) -> Int32 {
    // Code here...
    
    return 0
}

class Shell: LibShell {

    var commands: [String : LTCommand] {
        return super.commands+["python3", python3_main]
    }

}

let terminal = LTTerminalViewController(shell: Shell())

You can also add it to the suggestion bar:

LTHelp.append(LTCommandHelp(name: "python3", commandInput: .file))

See documentation

Acknowledgments

libterm's People

Contributors

coldgrub1384 avatar kab1r avatar

Watchers

James Cloos 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.