coldgrub1384 / libterm Goto Github PK
View Code? Open in Web Editor NEWiOS sandboxed terminal with Python, Lua and Clang
Home Page: https://libterm.app
License: MIT License
iOS sandboxed terminal with Python, Lua and Clang
Home Page: https://libterm.app
License: MIT License
When using grep to color the output, eg.
grep --color TestString */*
This should only color the TestString match in the lines, but it actually colors the whole line.
Is there a setting I can change so that only the matches are colored, not the whole line?
Thanks
The error occurs immediately when input()
is called.
error: Build input files cannot be found: '/Users/xingyue/outcode/git/LibTerm/LibTerm/Commands/ios_system/pbpaste+pbcopy.swift', '/Users/xingyue/outcode/git/LibTerm/LibTerm/Commands/ios_system/python3.swift'
import subprocess
...
subprocess.call('netsh interface ipv4 set interface ""Wireless Network" metric=1', shell=True)
Idk why. When i use the code on the top always force close the program.can any one help me?
When I run Django application or flask, and close it, if I launch python, I get this error :
Fatal Python error: _Py_InitializeCore_impl: no thread state found
Thread 0x000000016d57b000 (most recent call first):
File "/private/var/containers/Bundle/Application/1999D3C8-C607-4B47-B8A7-7307649AC7F4/LibTerm.app/python37.zip/selectors.py", line 415 in select
File "/private/var/containers/Bundle/Application/1999D3C8-C607-4B47-B8A7-7307649AC7F4/LibTerm.app/python37.zip/socketserver.py", line 232 in serve_forever
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/servers/basehttp.py", line 216 in run
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/commands/runserver.py", line 139 in inner_run
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/commands/runserver.py", line 104 in run
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/commands/runserver.py", line 95 in handle
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/base.py", line 369 in execute
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/commands/runserver.py", line 60 in execute
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/base.py", line 328 in run_from_argv
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/__init__.py", line 395 in execute
File "/var/mobile/Containers/Data/Application/8910A675-BC07-454C-8815-0DE97CB4F0A6/Documents/site-packages3/django/core/management/__init__.py", line 401 in execute_from_command_line
File "manage.py", line 17 in main
File "manage.py", line 21 in <module>
I often get this error when starting Python:
Fatal Python error: _Py_InitializeCore_impl: no thread state found
Thread 0x000000016b39b000 (most recent call first):
File "file.py", line 24 in <module>
how to use pod install this module ?
Or is there any project using this project.
There should be documentation for LibTerm
LibTerm version 5.1.4 (2)
".bash" or ".zsh" or .shrc ? what does call the file where to save it ? :)
thanks for all feedback :-D
./ios_error.h:67:24: error: unknown type name 'pid_t'
extern int ios_killpid(pid_t pid, int sig); // kill the current running command
^
./ios_error.h:74:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
extern const pthread_t ios_getLastThreadId(void);
^~~~~~
1 warning and 1 error generated.
make: *** [src/bc/lex.o] Error 1
Hi.I tried the following command, but the redirect ">>" does not seem to be recognized.
$ echo "aaa" > foo
$ echo "bbb" >> foo
$ ls
> foo
$ cat foo
aaa
$
Python 3.7.1 (default, Jun 23 2019, 10:58:12)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> print("spam\reggs")
spam
eggs
>>>
Maybe it would be possible to overwrite the same line by detecting a \r
carriage return.
Tested on the latest Libterm version (5.1.3).
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.
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.
I want Libterm to support Curses in Python.
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
$
I’m wondering if there is a command similar to sudo. I want to cd into some of the system files in directories such as /etc or /bin but I can’t because I get an error saying that access is denied. Is there a way to get around this and get into these folders?
When I exit the python command, LibTerm crashes.
Steps to reproduce:
Actual behaviour:
LibTerm exits immediately.
Expected behaviour:
python exits, but LibTerm does not.
Diagnostic steps:
The following commands do not crash:
The "Stop" autocompletion above the keyboard in LibTerm when python is open.
Further information:
I am using LibTerm 3.0.1 (3) on iOS 12.1 on an iPad Mini.
The following command works in OpenTerm:
nslookup localhost | awk '/Name/ {getline;print $0}'
But in LibTerm I get this error:
awk: syntax error at source line 1
context is
>>> ' <<< /Name/ {getline
missing }
awk: bailing out at source line 1
print: command not found
I think your app is really powerful enough now. Just wondering do u have any plan. Or if it is possible to integrate git command in your sand box environment. :)
Youtube-dL does not work because if it is run with arguments, then you always get sigabrt signal. Perhaps this problem occurs because of the presence of c code. If so, could you implement this module into the app?
When I run open
without arguments, the usage statement does not have a line break at the end:
Dull Bananas $ open
Usage:
open [Items to share ...]Dull Bananas $
It should look like this instead:
Dull Bananas $ open
Usage:
open [Items to share ...]
Dull Bananas $
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
Python command does not work on the App Store version.
The actual message is "awk: can't happen: unknown type 0 in freetr".
You might be interested in OpenTerm Issue #163, also opened by me, which may or may not be related. Mr. Holzschuch made a partial fix there.
awk dies trying to access NF #163
Below is a simple script and data to reproduce the error. I would not pay attention to the source line number. In another script I saw the same assert in an END pattern, and it seems to occur on whatever source line happens to be the last one. The sample also produced another intermittent error for me, whereby it printed #oo 1# instead of # foo 1#. It's a little weird, especially because I can't reproduce it consistently. Anyway one bug at a time. Maybe if this one gets fixed the other one will resolve itself.
$ cat s1null.awk
{
$1 = "";
print "#" $0 "#";
}
$ cat s1null-data.txt
1 foo 1
2 bar 2
3 baz 3
$ awk -f s1null.awk s1null-data.txt
# foo 1# (edit : escape the BOL # characters)
# bar 2#
# baz 3#
awk: can't happen: unknown type 0 in freetr
input record number 3, file s1null-data.txt
source line number 3
$
LibTerm version 5.1.4 (2)
I am wondering if there are any plans to add git to LibTerm. Would it be added in an app update? Or would someone have to make a git command in python?
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?
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
iOS app :
Can’t run any executables in /bin /sbin or ~/Documents
You should add the split
command to LibTerm
After restarting Libterm a few times, all files in ~/Library/bin
are moved to ~/Documents
. Even after a reinstall, this happens again. The ~/Library/bin
folder also disappears. The value of $PATH is:
$ echo $PATH
/var/mobile/Containers/Data/Application/8767232F-DBC1-4BD6-B271-41F78AEC8E98/Library/bin:/var/mobile/Containers/Data/Application/8767232F-DBC1-4BD6-B271-41F78AEC8E98/Documents/bin:/usr/bin:/bin:/usr/sbin:/sbin
Files previously accessible in ~/Documents
cannot be found from Libterm anymore (although still appear in Libterm’s Documents folder in the Files app.)
EDIT: Current workaround is to use the File button in Libterm and select Libterm’s Document storage.
Can this terminal support VT100 ?
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.
$ python -m pip install exif
$python
Traceback (most recent call last):
File "", line 1, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/private/var/containers/Bundle/Application/6CD9ECDD-99F5-4DE6-87A3-8F97C0C26C45/LibTerm.app/python37.zip/code.py", line 9, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/private/var/containers/Bundle/Application/6CD9ECDD-99F5-4DE6-87A3-8F97C0C26C45/LibTerm.app/python37.zip/traceback.py", line 5, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/private/var/containers/Bundle/Application/6CD9ECDD-99F5-4DE6-87A3-8F97C0C26C45/LibTerm.app/python37.zip/linecache.py", line 11, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/private/var/containers/Bundle/Application/6CD9ECDD-99F5-4DE6-87A3-8F97C0C26C45/LibTerm.app/python37.zip/tokenize.py", line 33, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/private/var/containers/Bundle/Application/6CD9ECDD-99F5-4DE6-87A3-8F97C0C26C45/LibTerm.app/python37.zip/re.py", line 143, in
AttributeError: module 'enum' has no attribute getattr
In the shortcuts app, the LibTerm action is kind of useful. In order for it to be truly useful, then please add an arguments field for this action. For example, python commands could be run with different input to do different things such as inputting a url from a YouTube video into YouTube-dl so that the video can be downloaded.
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 blinksh/blink#555 (comment)
LibTerm does not seem to support line-editing features, such as editing in the middle of a command. For example, if you have typed echo some long string to be displayed
and realized that you want to insert very
between some
and long
to make the command echo some very long string to be displayed
, you would have to delete all the text up to some
and insert very
, which is very annoying.
This may be considered a bug, since the shell prompt should behave mostly like edit
, which allows editing at any cursor position, but this is more like a feature request since one would be to detect whether the cursor position is "legal" (somewhere in the current command line and not in the shell prompt hostname $
or in previous commands)
The discontinued OpenTerm does support such editing feature. One can try it out by building it from source (no longer available from the App Store though). Furthermore, on a normal bash session on a computer you can use the arrow keys and insert some text in the middle assuming one have GNU readline
enabled (by default on an interactive shell). I know iOS do not have cursor keys in its built in on screen keyboard but there are still plenty ways to change the cursor position without using an external keyboard.
Moving the cursor is possible by clicking at a position in the command line or deep pressing the on screen keyboard and move your finger to move the cursor.
echo some long string to be displayed
The characters typed are inserted in the command line at the cursor position.
One can move the cursor, but typing have no effect unless the cursor is at the end of the command line.
I updated to LibTerm 5.0, and now it crashes whenever I open it.
Just two keystrokes can cause the shell to become unusable.
The cursor moving to the l
in ls
and then ls
deleted, allowing a new command to be typed.
The cursor jumps to column 0 (at the beginning of the shell prompt) after ⌃a:
and then after typing ⌃k to kill the remaining text on the line, the shell prompt is deleted:
At this point, typing ls ⏎ has no effect. ⌃c, ⌃d or ⌃z also have no effect. It appears the shell is totally hung.
This issue bears superficial similarity to #27 but is different:
LibTerm version 5.1.4 (2), Nov 11, 2019 at 08:30
, I do not have the issue described. For instance, if I typelong line
, so pressing ⏎ mid-line did not truncate the remainder.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.
Could you tell me how to install ios_system plz:( ? I read their documents but i can't install
The TERM
environment variable in LibTerm is set to xterm
. It should actually be xterm-color
(or maybe xterm-256color
) because the terminal appears to support ANSI colors.
This issue is causing an issue with my Python implementation of the Git CLI, since it's causing Click to think that colors are not supported and therefore removing ANSI colors.
Please consider adding jq. The code is very portable so hopefully it would not be too difficult.
When I use the id command, LibTerm crashes.
Steps to reproduce:
Actual behaviour:
LibTerm exits immediately.
Expected behaviour:
id output appears in the shell window.
Diagnostic steps:
The following commands do not crash:
The following commands do crash:
Further information:
I am using LibTerm 2.0 on iOS 12.1 on an iPad Mini.
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)
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.