Running SSHelper is a great way to access files on your phone. But completion of remote files (scp and rsync) using zsh doesn't work though. While using sshfs is a workaround but sometimes you just want to pull/push a quick file, it's not really satisfying.

Where lies the culprit, and how can I get file completion working properly via zsh?


The culprit is android's crippled ls command. Zsh's completion run ls -d1FL which /system/bin/ls doesn't understand.

A way to fix this is to edit /data/data/com.arachnoid.sshelper/home/.ssh/environment such that /data/user/0/com.arachnoid.sshelper/bin is the first entry in PATH. (SSHelper ships with a more complete ls)

Note that SSHelper might rewrite this file on updates?

| improve this answer | |
  • 1
    Nice detail, thanks! Speaking of updates: if you use F-Droid, you can find the app in my repo (it uses the devs signature, so you can simply update what you got from there). And besides, as you've identified the culprit as the pre-installed ls command: was that the "stock" one, or would the ls provided by Busybox have the same limitation? – Izzy Aug 22 '17 at 10:18
  • 1
    busybox ls is sufficient I think. Ie. busybox ls supports at least some of the flags that the system doesn't. – olejorgenb Aug 22 '17 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.