Top
Best
New

Posted by tosh 4 days ago

Termux(github.com)
359 points | 180 comments
haunter 4 days ago|
One of my favorite piece of software was made by the guy with Termux on his phone [0], absolute insane https://github.com/9001/copyparty

0, https://www.youtube.com/watch?v=15_-hgsX2V0&t=885s

mitkebes 4 days ago||
That's pretty funny, I use Copyparty a couple places, and never new it's origin.
zahlman 4 days ago||
You might be interested in a previous HN submission about it: https://news.ycombinator.com/item?id=45984864 including the author's commentary: https://news.ycombinator.com/item?id=46056869
mikewarot 4 days ago|||
This made me realize I could upgrade my phone to hold all of my photos, with room to spare, thanks to 1 TB microsd cards.

We're in the future!

pks016 4 days ago|||
Best thing I saw this morning! I will have to check it out once I get home
haunter 4 days ago||
It's incredibly good and runs on pretty much everything.

There is a read only demo here https://a.ocv.me/pub/demo/

bdcp 4 days ago||
[flagged]
cfiggers 4 days ago||
Termux is the first app I install on every Android device I get my hands on. It's astonishingly capable.

I have a Bluetooth keyboard case for my Android tablet. All the time, I use Termux to ssh into my Linux machine over my home network and code on it in Neovim from my couch.

I don't bother with the default notes app on my phone. Termux + Neovim running vimwiki and syncing to a private GitHub repo is way better.

Most stuff you want at the CLI is in the Termux package repository. On the occasions when it isn't, you can install clang, make, cmake, ninja, whatever libraries you need, and build it from source. At that point most stuff just works.

Termux is incredible and single-handedly keeps me running Android.

firecall 4 days ago||
What keyboard case do you use?

My android phone is a Pixel 8 and that sounds cool :-)

cfiggers 4 days ago||
I actually have like, four different ones... :^))) I'm a bit of a keyboard fiend.

The main one I use with my Android tablet specifically is a no-name brand, knock-off "magic keyboard"-style folio case that I got on AliExpress for like, 45 USD. I ordered the English layout, I received the Spanish one (which is mostly the same but had additional legends for Spanish characters). Le sigh. It's AliExpress, I didn't bother contacting support.

For my phone, I have a really old Zagg one that was originally for an iPad. The iPad has long since died but the keyboard lives on. Woo!

The main keyboard I type on all day at my desk is a Logitech Pebble K380s. It can store three different connection profiles, which can be either Bluetooth or Logi unified receiver. So I have one of those profiles set to connect to my Pixel 8 via Bluetooth (typing from that now). Makes toggling back and forth between that and my desktop very smooth.

On a "real keyboard" (like this K380s) there's a dedicated Esc key. Most tablet folio cases don't have Esc. I found an app called "External Keyboard Helper Pro" that lets me rebind Caps Lock to Esc. That makes Neovim much more pleasant.

cromka 4 days ago|||
Ali support is actually quite good nowadays in my experience, I haven't had a single frustration with them in quite a while.
firecall 4 days ago|||
Thanks for the info!
harvie 4 days ago|||
I beleive Android 16 now comes with termux-like Linux environment that can be enabled via developer settings menu.
push0ret 4 days ago|||
Big difference! That's a full VM, while Termux is more like a Debian container. For most use cases you will have a better time with Termux, which also ships useful Android integrations such as clipboard and notifications.
cromka 4 days ago||
Wait, isn't Termux based on Alipine?
Crestwave 4 days ago||
Nope, it comes with apt. You might be referring to iSH on iOS, which does use Alpine in a VM.
functionmouse 4 days ago||||
Yeah but it sucks. There's a button in its settings to install a Debian chroot environment; gave it a go and it bricked itself, had to clear the app's storage and factory reset it.
NoGravitas 4 days ago|||
Yeah, I can always use the Android Terminal once. If I re-open it, it says it's corrupted, and has to delete and re-install its minimal Debian environment.
getpokedagain 4 days ago||||
Add to this list that it tends to not work while connected via a VPN. Not sure why but this makes me very skeptical of it.
JoshTriplett 4 days ago|||
Probably because their handling of VM networking isn't very robust.
getpokedagain 4 days ago||
Why should booting a Linux VM require network access right away.
JoshTriplett 4 days ago||
Probably because it's trying to establish a network connection, and it might be running a networking setup that blocks until the network is up. Also, it's trying to run networking with the host so it can run things like the storage balloon driver and mounting the host filesystem.
functionmouse 4 days ago|||
that's sketch city. Why does it care? What are they looking for?
getpokedagain 4 days ago||
I'm thinking maybe they just want me to keep using termux over their sketchy shit
gf000 4 days ago|||
A bug in a not even beta program makes it 'suck'?
Antibabelic 4 days ago|||
I don't understand this comment. Yes, absolutely. Alpha versions of software absolutely suck. The end goal is making it not suck, but if it's full of breaking bugs your can't just say it doesn't suck just because they're expected.
yjftsjthsd-h 4 days ago|||
If it's not even a beta, then it can hardly be replacement for termux.
fmajid 4 days ago||||
It's extremely flaky and unreliable, however:

https://social-cdn.vivaldi.net/system/media_attachments/file...

cess11 4 days ago||||
Even more reason to keep supporting Termux.
Aachen 4 days ago||||
(it's unreliable, see second edit)

Does it? I've looked at it only briefly (like enabled it, waited a while for it to download something big, then got a basic shell) but it seemed much less capable than Termux. Can you get cell tower info or copy to clipboard for example, or use other Android APIs?

Edit: looked into it a bit more, /etc/issue says it's a Debian 13 (latest stable), apt works with sudo (this is a locked-down device where I don't have root permission on, why does it need a fake sudo to use apt?) but of course programs like wavemon are useless because Android doesn't let you access the WiFi interface. There's no settings besides port forwarding and resetting the "partition". I don't see any documentation or info on how/whether you can interface with the rest of the system in any way. Looking on the web for Android terminal or "Linux developer environment" (as the system settings calls it) is predictably useless and only results in Google's unrelated Android SDK or other terminal emulator apps

Edit 2: okay, beware of it: I was curious if the same "you can't make the OS not kill your script" problem also happened in this OS terminal and.. it's worse. So I ran `while true; do date >> latest.txt; sleep 10; done` to see how long it'd stay alive and then did some other tasks like turning the screen off and on, opening a navigation app and zooming into a dense city, and loading a few websites. Locked the screen once more for good measure and then unlocked and opened the terminal. Guess what? It's broken. Not just crashed: I simply cannot start it anymore. The only "error handling" (Fehlerbehebung it says) step it offers is to delete all data and start with a clean system. The stack trace says there's a nullpointer in TerminalWebViewClient, with the next line being in Trichrome. It's a web browser apparently

yjftsjthsd-h 4 days ago|||
> apt works with sudo (this is a locked-down device where I don't have root permission on, why does it need a fake sudo to use apt?)

It's a VM running normal Debian. Inside the VM, you do have root, and that sudo isn't fake.

_ea1k 4 days ago|||
YMMV, but I've had pretty good luck with just force closing it and launching again when getting errors like that. It doesn't necessarily mean the whole environment is corrupt, even though that is the recovery option that is presented.

It is very unreliable though. I hope Android 17 improves it, as other than the restart issues, I've generally found it to be very functional.

kreddor 4 days ago||||
Even if you have Android 16 it's not guaranteed the terminal works. It's disabled by Samsung on my Galaxy A55 for some reason. Maybe the hardware doesn't support the feature.
JoshTriplett 4 days ago||||
I'm really looking forward to that being more usable, but it isn't quite there yet. The GUI especially.
prettyblocks 4 days ago|||
Yes, it's good, but it doesn't have access to any sensor apis.
mbreese 4 days ago||
Not to get into an iOS vs Android thing, because that’s not the point (it’s okay to appreciate both or neither, you do you).

But this is one of the things I really would love to have on my iPhone that I’m jealous of the Android ecosystem for. I know there are alternatives for iOS and I’ve used them (no need to list them here, this thread isn’t about iOS). For me, a really good terminal/CLI with good integration with the OS would be killer. But I know I’m niche and unlikely to see such a thing outside of SSHing to a remote VM.

Rygian 4 days ago||
My usecase for Termux: most pictures get backed up properly into the home NAS, but the sync process sometimes skips a few [1] (which is exasperating, but here we are still not migrated to Immich).

So I have a python script in the NAS that calculates the MD5 checksum of every photo and video, and generates a shell script that, when executed on the phone, will calculate the MD5 on the local device, and delete if it is equal to the NAS.

The generated shell script gets sent to the phone, then I execute it from within a Termux window, pointing at the DCIM folder.

I can free up tens of GB of memories with reliability in the face of a misbehaving sync algorithm.

[1] https://help.nextcloud.com/t/auto-upload-is-skipping-random-...

jcynix 4 days ago||
With Termux I have rsync at hand, which can compute checksums, delete files after the transfer, etc. That's why I do my complete backup with Termux. And I sort the images on the phone into dated subfolders before syncing them.

And having tools like exiftool, ffmpeg, and ImageMagick among others available in Termux is wonderful.

troyvit 4 days ago||
Yeah same in fact that's how I discovered Termux. I had an rsync.net account and thought that since rsync and ssh are so ubiquitous it should be simple to set up back-ups from my android phone. Boy was I wrong. The android apps that support rsync were all janky or suspiciously closed. Termux + rsync + Termux API's job scheduler does the trick. I think it's a bit of a drain on my phone battery but I won't complain given I own my photo back-ups from top to bottom (though I rent from rsync.net)
dizhn 4 days ago|||
That nextcloud issue is quite weird and people seem to have had better luck with the sync app downloaded from places other than the Play store. I personally would lose any confidence in the app and use a completely separate thing to do the syncing if that happened to me. I actually did use the nextcloud client on pc a while ago and it was kind of fickle in other ways too anyway so I stopped using it.
ktm5j 4 days ago||
I really like SeaFile for this kind of thing. It follows the "do one thing and do it well" philosophy. It's just file sync with some basic document editing features (markdown, .doc I think). Super fast and dependable, highly recommend.

https://www.seafile.com/en/home/

overfeed 4 days ago|||
> I execute it from within a Termux window...

If you install Termux widgets, you can directly start the script from your Android launcher's Home screen.

Rygian 4 days ago||
Since this process happens just a couple times per year, I find it reassuring to edit the file on the phone, check its contents, run it first in dry-run (the default), grep the output to my leasure, and only then run it in anger.
overfeed 4 days ago||
The widget would be overkill. My tasks were more frequent - several times weekly. The scripts were a hacked-up first step towards cron automation, and occasionally needed to be re-run. Everything is now in a neat, cron-triggered Home Assistant automation with events instead of questionable 'sleep' lines.
ksynwa 4 days ago|||
Are you sure all this is really necessary? I just use round sync to copy over the camera and whatsapp media folders over ssh/sftp to my SBC. Then once every several months I delete the files from these foldes which exceed a given mtime (using find in termux).
Rygian 4 days ago||
I take it as a personal preference to never delete a copy of a file I care about, until I have taken positive proof that it is copied safely where it belongs.

I have deep trust issues with commands that work on more than one file at a time.

thekoma 4 days ago||
How come you don’t just send the md5s to delete rather than the shell script?
vasco 4 days ago|||
I guess it's a more flexible design that allows to change the criteria for deletions in the future. You still need to calculate md5s on the phone either way.
Rygian 4 days ago|||
That would definitely work too.

What I like about my process is that there is only one source script (the python one) to keep around.

bergheim 4 days ago||
With how AI based dev is going, I'm guessing more and more people will discover and start using termux, tmux and the like.

Typing on a phone sucks, but at least modal modes (vim) and unexpected keyboard[1] makes it somewhat tolerable.

1: https://github.com/Julow/Unexpected-Keyboard

zahlman 4 days ago||
I've been dreaming lately of a Switch 2-sized device with ergonomic handles on the sides, with buttons built into the handles that implement a chording keyboard (like how a braille writer works).
jatora 4 days ago|||
suffice it to say that you just changed my morning with this link lol. god i love this keyboard.
zem 4 days ago||
wow, that does look like the perfect companion app to termux! thanks for the pointer.
pxc 4 days ago||
Since no one makes Android devices with hardware keyboards anymore, I almost never use this kind of software anymore. After getting burned by a couple of Kickstarter phones hampered by half-baked software and total lack of updates, the only thing I could rationally conclude is that Android as a productivity platform is a lost cause.

When Android was new, I very frequently used Termux and ConnectBot with my first few Motorola Droid phones. For a brief moment, I had a working phone with a great physical design only held back by an outdated chipset and being locked to Planet Computers' abandonware. I could touch-type at 80 WPM on an easily pocketable device! Termux shone there.

So many things about Android were not just more exciting in terms of potential when it was new, but actively better: wider variety of hardware, widely unlocked bootloaders, no remote attestation, etc. Termux sadly feels like a painful reminder of that to me.

crtasm 4 days ago||
There's two upcoming I look forward to seeing reviews of:

https://www.androidauthority.com/unihertz-titan-2-elite-qwer...

https://www.engadget.com/mobile/smartphones/clicks-is-bringi...

angra_mainyu 4 days ago||
I have a tiny but very comfy bluetooth keyboard, though 90% of the time I use a keyboard with android I'm using my tablet (and it's easy to forget it's not a laptop).
nickjj 4 days ago||
I use Termux to run SSH on demand, it's quite nice for rsync'ing files between my phone and desktop.

The on demand nature of it is a major selling point to me. When I open Termux and run SSH it's up, if I shut down Termux, SSH goes away with it. That and I can use rsync which is a tool I've been using for syncing files for a long time.

There's no need to run always-on tools like LocalSend or SyncThing, at least not for my use case. I have a little "sync" shell script on my desktop I can run to easily sync files "desktop TO phone" or "phone TO desktop".

nisiddharth 3 days ago||
There's an app "Material Files", there you can add SSH servers as storage locations and then copy paste files as if the locations are mounted in your phone.
sejje 4 days ago||
Fwiw I use syncthing, but I don't leave it always on.
Fluorescence 4 days ago||
I love termux. I can run my normal terminal environment - tmux, fish, just, git, zoxide, yazi etc. and build rust apps. With decent auto-complete/fuzzy-search, it's very ergonomic for only needing a couple of key presses to get things done. I'm impressed that TUI apps like yazi/nnn respond to touch. It's a very viable app platform for those inclined.

Out of curiosity, is there an equivalent on ios with that level of support?

nasretdinov 4 days ago|
In iOS we can only use something like ish.app which emulates x86 and runs full Linux distro instead, with predictably much lower performance than Termux (due to JIT being banned in iOS apps), but without any restrictions Android has on the executables
maxkfranz 4 days ago|||
iSH is great as an ssh client. It has a good font out of the box, so it displays tmux and neovim properly.

a-Shell should be faster than iSH for local stuff since the tools are compiled natively, but nothing on iOS, as far as I know, compares to Termux on Android.

nasretdinov 4 days ago||
a-Shell looks amazing, thanks for mentioning it
MarsIronPI 4 days ago||||
Why does Apple ban JIT? It clearly doesn't ban emulation inherently, so why is emulation OK but not JIT?
tadfisher 4 days ago||
I believe it's a ban on executing any runtime-generated or downloaded machine code, not just JIT in particular.
MarsIronPI 3 days ago|||
Then how is iSH allowed on the app store?
tadfisher 3 days ago||
Elsewhere in this thread, someone mentioned that ISH is a full PC emulator running Alpine. You wouldn't necessarily need JIT or native execution for a software VM.
nasretdinov 3 days ago|||
Probably ban on any unsigned code tbh
DrNefario 4 days ago|||
I don't have an iPhone, but wouldn't UTM be better for that use case?
nasretdinov 4 days ago||
UTM can't be installed from the App Store unfortunately, and without a developer license you are limited to 7 days for each successful on-device reinstall
dudewhocodes 4 days ago||
Apple somewhat lifted the emulator restrictions on the App Store which means you can install UTM from here: https://apps.apple.com/us/app/utm-se-retro-pc-emulator/id156...
nasretdinov 4 days ago||
Nice, I must've missed that. Downloading it right away :)

Edit: well, it's also very slow unfortunately. I believe iPhone CPUs either don't support virtualisation or they don't expose it (edit #2: it's the latter). Either way, QEMU is struggling quite a bit, and due to it being a GUI it's even slower than what iSH could do

mg 4 days ago||
Is Termux still needed, now that new Android phones have a full Linux available?

I keep reading on https://www.reddit.com/r/androidterminal/ about user experiences with it and it seems pretty great.

basilikum 4 days ago||
Termux is just a terminal emulator. When you run programs in Termux they run natively on your Android system inside the normal Android sandbox of the Termux app. That has some limitations, for example software has to be compiled to use the paths of the Termux environment. Termux can't just install software into /bin and you can't write into /etc. So everything depending on anything more than the base Android system like dependencies installed by Termux has to be compiled specifically for the paths of the Termux environment. But it also advantages especially when you want a Terminal that is actually part of your Android system. You can just natively access the shared storage for everything Termux has permission to. You can also use the Android API out of Termux – for some things you need to install the Termux:API Addon app – and get stuff like GPS, SMS and contacts.

The Android Terminal app is just a view to a full VM. If you want a more traditional Linux system on your phone alongside Android instead of a Terminal in Android, essentially having a second system just conveniently running on the hardware of your phone, then that's for you. However it does also use more storage.

jhbadger 4 days ago|||
I've tried both, and Termux is still far better. At least when I tried it a couple of months ago, the Linux terminal lived in its own sandbox isolated from the normal Android directories. Yes, I get how this might be "safer", but it means I can't move files around in the command line which is my primary use of Termux (I can't stand using a GUI to arrange and rename files)
gf000 4 days ago||
/mnt/shared is mounted to see your downloads and the like, so you can manipulate them just fine.
rini17 4 days ago|||
Apparently the OEM must support it (the AVF virtualization).
chocochunks 4 days ago||
The phone's hardware must also support it. It needs non-protected VM support which is available in Exynos SoCs but not Qualcomm which is why some Samsung phones have it but other arguably better phones don't (e.g, S25 Ultra VS. Flip 7).
WinstonSmith84 4 days ago|||
Right, I enabled it, and got that exact error when starting the Terminal app on my Xiaomi 15: "Non-protected VMs are not supported on this device."
JoshTriplett 4 days ago|||
Anyone know if the Samsung Z Trifold has VM support that works for the Android Terminal?
chocochunks 3 days ago||
No not right now at least, because it uses Qualcomm.
JoshTriplett 3 days ago||
Unfortunate. Looking forward to a trifold with AVF support. And, ideally, support for unprivileged AVF being available for third-party virtualization applications to use.
esperent 4 days ago|||
Interesting, first I've heard of that. It's android 16+ apparently. My Galaxy S21 FE is on Android 16.

I searched "Linux" in the settings and it found this experimental "Run Linux Terminal on Android" toggle... Which doesn't work. Tapping it won't turn it on. Oh well.

elcapitan 4 days ago|||
Oh wow, thanks for mentioning this, I totally missed that this was introduced.
nicman23 4 days ago|||
it is trash on the hw acceleration side, while termux has vulkan linux to vulkan android wrappers - which in future will probably do hw encode and decode as well
306bobby 4 days ago||
Using ffmpeg packages in termux you can already access the mediacodec apis for hw accelerated encode/decode
nicman23 4 days ago||
yeah that is cool but i meant for something like firefox
mystifyingpoi 4 days ago|||
As you say, it is still very useful for older phones. Only the newest top-of-the-line ones got the real thing.
prmoustache 4 days ago||
last time I tried the linux terminal running on a vm was buggy and slow.
anasrin 4 days ago||
Best terminal emulator on Android, my day to day basis is note-taking (fzf, Neovim, Git) and SSH (when I'm too lazy to open up computer).

Also you can build some CLI or TUI using Go and compile using Android NDK and run it on Termux.

bluebarbet 4 days ago|
Honest question, as a heavy desktop TUI user who has had Termux installed for years. A terminal (emulator) is a keyboard-based environment. How on earth are all you fans making it work with a tiny touchscreen?
mjmas 4 days ago||
I have Unexpected Keyboard which gives me most keys including Alt, Ctrl and Esc as well as F-keys.

https://github.com/Julow/Unexpected-Keyboard

dotancohen 4 days ago|||
I often use a Bluetooth keyboard with Termux. But as a mechanical keyboard affectionate with a veritable museum of ergonomic and mechanical keyboards, the Samsung S-Pen is good enough for terminal work. I use SSH, VIM, and lately Org mode in Termux. If I'm at a desk I still use a Bluetooth keyboard, but if I'm out then the S-Pen is a fine enough substitute.

Right now I'm on an S24 Ultra, before that a Note 10 Lite, and before that another Note 10 Lite.

darkstarsys 4 days ago||
I just got an S25 Ultra. How do you use the S-Pen with termux? I do have handwriting enabled in gboard and the S-Pen works for writing regular text. But can it write special characters, ctrl/alt, or something else to go beyond what regular gboard gives? (I also have Unexpected Keyboard for Emacs, but S-pen input seems like a cool idea if it can work around limitations of gboard)
dotancohen 4 days ago||
For bash commands I hunt and peck with it. I use glide typing for English and Hebrew text. For special keys Termux displays a bar just above the keyboard. I don't remember if that's something that I had to configure.
cess11 4 days ago|||
I use PentiKeyboard, it can send basically all the byte sequences I'm accustomed to having available plus it has a shortcut for sending ctrl+b to tmux.

https://play.google.com/store/apps/details?id=de.software_la...

Either that or I connect a wireless physical keyboard.

Edit: The killer feature of Penti is that it is transparent and allows you to put the 'buttons' where it is convenient to place the fingertips. Unlike regular software keyboards which hide half the screen and have 'buttons' that are pretty much thumbs-only. Since I code a lot I'm not particularly keen on mainstream next-word-guessing either.

ifelsewhy 4 days ago|||
This is why I'm looking forward to the new Android devices with keyboards. I can't do anything productive on a touchscreen.
dotancohen 4 days ago|||
You might want to look at the S-Pen. I can not stand the on-screen keyboards with my fingers, but they are not so bad with the S-Pen. That's the only reason I still buy Samsung devices.
jhbadger 4 days ago|||
There are better software keyboards than the default that you can install. I use Unexpected Keyboard, which supports ctrl, alt, tab, and other keys needed for Unix work.
jcynix 4 days ago|||
First of all, typing shell commands isn't that annoying on the tiny touchscreen. Caveat: heavy terminal users here ;-)

Then you can attach a Bluetooth keyboard. And you can import scripts (Perl, Python, Shell, ...) via ssh from other devices. Last but not least, you can start an ssh server on the device and use Termux from your desktop or laptop. And you can start a web server, to access your device's media files, etc.

mklein994 4 days ago|||
For me, it was how I learned Vim. The awkward keyboard pushed me towards learning more efficient keystrokes, so now I'm very comfortable with Vim.

I would learn it on the bus, and at the time I didn't have a data plan, so I could only access things I had already downloaded. The `:help` documentation is very thorough.

TapamN 4 days ago|||
What I use for my phone (Planet Computer Astro Slide) has a Psion 5-style physical keyboard built in.
tossit444 4 days ago|||
Staring very close at the screen.
genezeta 4 days ago|||
Portable Bluetooth keyboard.
ezequiel-garzon 4 days ago|||
Sessions tend to be way shorter for me, but it's great to have.
poolnoodle 4 days ago||
Tiny fingers or bluetooth keyboards
More comments...