Skip to content
/ LibTerm Public
forked from ColdGrub1384/LibTerm

iOS sandboxed terminal with Python 3.7 and Lua 5.3

License

Notifications You must be signed in to change notification settings

cccvt/LibTerm

Repository files navigation

LibTerm

LibTerm is a terminal for iOS.

This app is like @louisdh - OpenTerm but this terminal is embeddable in your own app and it supports Lua and Python 2.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.

Building

  1. Clone all submodules
  2. Download release.tar.gz from ios_system latest release.
  3. Unarchive the file.
  4. Move ios_system to the ios_system.

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], shell: LibShell) -> 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))

Acknowledgments

About

iOS sandboxed terminal with Python 3.7 and Lua 5.3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.8%
  • Shell 1.2%
  • Other 1.0%