iOS sandboxed terminal with Python, Lua and Clang

Overview

LibTerm

LibTerm is a terminal for iOS with Python 3.7 and Lua 5.3. Supports iOS 13 dark mode and multi window.

Download on the App Store

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!

Programming languages

LibTerm contains Python 2.7, Python 3.7, Lua and you can even code C. Compile your C sources with clang into LLVM IR code and interpret the LLVM IR code with the lli command.

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

Acknowledgments

Comments
  • Python 3.7 doesn't work.

    Python 3.7 doesn't work.

    I made Python 3.7 an In App Purchase. But the purchase doesn't work. Also, people that downloaded the app when Python 3.7 was free should not have to purchase it. I submitted a new update fixing that.

    opened by ColdGrub1384 13
  • LibTerm pulled from AppStore?

    LibTerm pulled from AppStore?

    Apparently, when I tried to access the LibTerm app here (in Singapore) within Apple’s appstore, there was no search results. Also, when the appstore link in Github is accessed, the App Store claims that the app does not exist in this region. I hope that this app does not get pulled from the App Store like OpenTerm. It, as well as Libterm was a great app.

    opened by ongyx 6
  • pbpaste redirection not working

    pbpaste redirection not working

    Neither | nor > works with pbpaste. Maybe it is going to stderr instead of stdout? A simple demo: $ echo 'foo bar' > tmp $ wc tmp 1 2 8 tmp $ cat tmp | pbcopy $ pbpaste foo bar $ pbpaste | wc foo bar 0 0 0 $ pbpaste > tmp foo bar $ wc tmp 0 0 0 tmp $

    opened by adbennet 6
  • need a way to send ^C or ^D to a running command

    need a way to send ^C or ^D to a running command

    I cannot figure out how to send ^C,^D etc. using logitech K380 keyboard, nor with ios soft keyboard. Believe me I tried every key combination. OpenTerm has a "Stop" on the input assistant suggestions bar, which sends ^C (I would usually prefer ^D, so that awk will run the END pattern). Here is a simple scenario reading stdin, the only way out that I can think of is to close the tab: $ awk -- '{print NR, $0;}' foo 1 foo bar 2 bar how to exit? 3 how to exit? Edit: Actually, I'm not sure if closing the tab is sufficient, it seems to leave stdout in other tab messed up.

    opened by adbennet 6
  • Shortcut ios how to access to the input field with a python script

    Shortcut ios how to access to the input field with a python script

    Hey,

    I already see the two issues on the subject but i didn't understand how we are supposed to access the input fiel of Shortcut with a python script.

    image

    I want to execute a script with Shorcut on my phone. For this I have a script who i execute with the command python test2.py in the cd $SHAREDDIR. I want to add an input to this script so i add one in the input field below but I can't access it. I try to use a classic myvariable = input() but it return an EOFError ( If i understand that say that there is no input), I also try with a sys.stdin.read(i) and ... .readlines(i) but it give me a null result. I also try with fileinput.input() and no more result.

    How should I access to this input, can they be use like that or is there another way to do what i want ?

    opened by P4UL-M 5
  • Pafy error

    Pafy error

    Hi i have installed Pafy module in libterm and when executing a python script from file (2.7 and 3.7) the first time it works but when i execute it the second time it gives me error. If i kill the app and reopen it, script first works and second time it fails. It seems like python does’t close properly after executing the script.

    This is the script:

    import pafy urlyoutube = ('https://youtu.be/aDCcLQto5BM') video = pafy.new(urlyoutube) print (video.title)

    And here you can see the error:

    LibTerm version 4.3 (1), 14 Jan 2019 at 20:40 Last login: 19 Jan 2019 at 15:31 iPhone $ python maininput.py Danny Ocean - Me Rehúso (Official Audio) iPhone $ python maininput.py Traceback (most recent call last): File "maininput.py", line 3, in video = pafy.new(urlyoutube) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/pafy/pafy.py", line 124, in new return Pafy(url, basic, gdata, size, callback, ydl_opts) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/pafy/backend_youtube_dl.py", line 29, in init super(YtdlPafy, self).init(*args, **kwargs) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/pafy/backend_shared.py", line 96, in init self._fetch_basic() File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/pafy/backend_youtube_dl.py", line 38, in _fetch_basic self._ydl_info = ydl.extract_info(self.videoid, download=False) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/youtube_dl/YoutubeDL.py", line 793, in extract_info ie_result = ie.extract(url) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/youtube_dl/extractor/common.py", line 508, in extract ie_result = self._real_extract(url) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/youtube_dl/extractor/youtube.py", line 2026, in _real_extract upload_date = unified_strdate(upload_date) File "/var/mobile/Containers/Data/Application/477FB538-0FA2-452F-82A9-275A79C028E8/Documents/site-packages3/youtube_dl/utils.py", line 1249, in unified_strdate upload_date = datetime.datetime.strptime(date_str, expression).strftime('%Y%m%d') TypeError: 'NoneType' object is not callable

    opened by masterxp22 5
  • Python 3

    Python 3

    Would you be opposed to embedding Python 3 instead of Python 2? Python 2 is going to be dead next year, and I don't think a lot of people still want to stick to Python 2 for any new scripts. See also the discussion at https://github.com/blinksh/blink/issues/555#issuecomment-445501018

    enhancement 
    opened by goerz 4
  • Is there a built in editor like nano or vim?

    Is there a built in editor like nano or vim?

    I am just curious if there is a text editor built in to LibTerm such as nano or vim. If not, would it be possible to create one or would iOS restrict that?

    opened by Shock9616 3
  • Is it possible to change current working directory to iCloud Drive root?

    Is it possible to change current working directory to iCloud Drive root?

    Description

    Currently, it is not possible to access any files that is not stored in any sub-folder of iCloud Drive (that is, stored directly under the root of iCloud Drive or any other storage providers such as Dropbox or Google Drive)

    Notes

    I know that LibTerm can change working directory to folders created under the iCloud Drive by the little folder icon on the top-right corner, but that only allows viewing files created under a directory, not in the root of the storage location

    Furthermore, it might not be possible due to iOS's restrictions on what directories an app can browse, but I wondered why Apple allow apps to read and even modify the contents under any sub-folders of a storage location, (iCloud Drive, Google Drive, etc.) but not directly under the drive root. (except for the native Files app, of course)

    question 
    opened by kevin-he-01 3
  • Siri Shortcuts Action

    Siri Shortcuts Action

    When I run commands through Shortcuts app, I can't access the normal Documents directory. When I set its current directory as ~, it goes to /private/var/mobile/Containers/Data/PluginKitPlugin/078ACFAA-F951-4B67-9AC1-C74FFD2C2DC3. It should instead go to /private/var/mobile/Containers/Data/Application/B666351D-5F34-4CE2-8A48-A2EF0991F819/Documents. I tried to manually type in that path for the cwd, but it says operation not permitted.

    You should also add the ability to send data as stdin with this Shortcuts action, and you should also improve the action's description.

    bug enhancement 
    opened by dullbananas 2
  • Syntax error when using pip

    Syntax error when using pip

    When I try to use pip (python -m pip), there is a syntax error (line 57):

    BUNDLED_MODULES = ['appdirs'. 'chardet', 'colorama', 'python-dateutil', 'distlib', 'distro', 'future', 'idna', 'ipaddress', 'lockfile', 'progress', 'pytoml', 'pytz', 'requests', 'six', 'urllib3', 'webencodings']
    

    As you can see, there is supposed to be a comma after appdirs, instead of a full-stop. Here is the traceback:

    Traceback (most recent call last):
      File "/private/var/containers/Bundle/Application/756DDAF8-7B2B-4140-995F-604E486BDAB9/LibTerm.app/python37.zip/runpy.py", line 183, in _run_module_as_main
      File "/private/var/containers/Bundle/Application/756DDAF8-7B2B-4140-995F-604E486BDAB9/LibTerm.app/python37.zip/runpy.py", line 153, in _get_module_details
      File "<frozen importlib._bootstrap_external>", line 860, in get_code
      File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/private/var/containers/Bundle/Application/756DDAF8-7B2B-4140-995F-604E486BDAB9/LibTerm.app/site-packages/pip.py", line 57
        BUNDLED_MODULES = ['appdirs'. 'chardet', 'colorama', 'python-dateutil', 'distlib', 'distro', 'future', 'idna', 'ipaddress', 'lockfile', 'progress', 'pytoml', 'pytz', 'requests', 'six', 'urllib3', 'webencodings']
                                    ^
    SyntaxError: invalid syntax
    
    bug 
    opened by ongyx 2
  • Dropbox support

    Dropbox support

    I see that there is some notion of interoperability already in libterm for using dropbox as backing directory.

    But the radio button does nothing. Broken? Coming soon? AACD3E0E-C70A-4DCE-B36C-D102187D2DEB

    opened by kert-io 0
  • find -exec doesn't work.

    find -exec doesn't work.

    The following command works fine in iSH, but in LibTerm it halts right after the first matching file, and then seems to read from stdin: I can enter text but it's just that it doesn't react at all to Stop and EOF:

    find * -exec echo found {} \;

    opened by TheRealzwaa 0
  • Add the possibility to modify the PATH

    Add the possibility to modify the PATH

    I mean that it would be cool to actually be able to modify the path, and to be able to execute shell files by typing their path in the terminal (example: $ ./test.sh)

    opened by Zpiboo 0
Owner
Emma Cold
I code developer tools for iOS.
Emma Cold
Forblaze - A Python Mac Steganography Payload Generator

Forblaze - A Python Mac Steganography Payload Generator Author: AsaurusRex Disclaimer DO NOT use this project for purposes other than legitimate red t

null 54 Sep 5, 2022
Python VM written in Swift

Violet Violet is one of those Swift <-> Python interop thingies, except that this time we implement the whole language from scratch. Name comes from V

LiarPrincess 157 Dec 14, 2022
A terminal for iOS, with multiple windows

a-shell: A terminal for iOS, with multiple windows The goal in this project is to provide a simple Unix-like terminal on iOS. It uses ios_system for c

Nicolas Holzschuch 1.7k Jan 8, 2023
Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor

CPU-Lock Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor (Designed for Apple Silicon). Usage Download the

BitesPotatoBacks 0 Aug 11, 2022
Validate iOS, Android, and Mac localizations. Find errors in .strings, .stringsdict, and strings.xml files.

Locheck An Xcode and Android localization file validator. Make sure your .strings, .stringsdict, and strings.xml files do not have any errors! What do

Asana 73 Dec 13, 2022
Easy CBOR encoding and decoding for iOS, macOS, tvOS and watchOS.

CBORCoding CBORCoding is a lightweight framework containing a coder pair for encoding and decoding Codable conforming types to and from CBOR document

Joe Newton 23 Nov 8, 2022
TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.

TypeStyle TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app. Featu

Eugene Belinski 31 Dec 14, 2022
An open source Instapaper clone that features apps and extensions that use native UI Components for Mac and iOS.

TODO: Screenshot outdated Hipstapaper - iOS and Mac Reading List App A macOS, iOS, and iPadOS app written 100% in SwiftUI. Hipstapaper is an app that

Jeffrey Bergier 51 Nov 15, 2022
Zip - A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip.

Zip A Swift framework for zipping and unzipping files. Simple and quick to use. Built on top of minizip. Usage Import Zip at the top of the Swift file

Roy Marmelstein 2.3k Jan 3, 2023
Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects

SwiftyPick ?? ?? Useful Swift code samples, extensions, functionalities and scripts to cherry-pick and use in your projects. Purpose The idea behind t

Manu Herrera 19 May 12, 2022
Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer documentation.

Swift-DocC is a documentation compiler for Swift frameworks and packages aimed at making it easy to write and publish great developer docum

Apple 833 Jan 3, 2023
Customize and resize sheets in SwiftUI with SheeKit. Utilise the power of `UISheetPresentationController` and other UIKit features.

SheeKit Customize and resize sheets in SwiftUI with SheeKit. Utilise the power of UISheetPresentationController and other UIKit features. Overview She

Eugene Dudnyk 67 Dec 31, 2022
A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

李阳 4 Dec 29, 2022
Tools and helpers to make building apps faster and safer.

The UBFoundation framework provides a set of useful tools and helpers to make building apps faster and safer.

Ubique 7 Dec 19, 2022
Paul Hudson redesigned and remastered the original MoonshotApp. And so I followed the tutorial

Moonshot App for iOS. parsing some json files, using generics, and creating multi page app. Application provides simple informations from the Apollo m

Pavel Surový 0 Dec 7, 2021
Async+ for Swift provides a simple chainable interface for your async and throwing code, similar to promises and futures

Async+ for Swift provides a simple chainable interface for your async and throwing code, similar to promises and futures. Have the best of both worlds

async_plus 132 Jan 6, 2023
A lightweight extension to Swift's CollectionDifference, supporting moves in addition to removals and insertions, critical when updating interfaces and managing reference types.

DifferenceTracker is a lightweight extension to Swift's CollectionDifference. It defines moves in addition to removals and insertions, critical when updating interfaces and managing reference types.

Giles Hammond 2 Nov 25, 2022
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

Sung Woo Chang 136 Dec 25, 2022