trzsz / trzsz-go

trzsz-go is the go version of trzsz, makes all terminals that support local shell to support trzsz ( trz / tsz ).
https://trzsz.github.io/go
MIT License
884 stars 53 forks source link

Crash on Termux (aarch64) #39

Closed marco-trovato closed 1 year ago

marco-trovato commented 1 year ago

On Termux from Android with an ARM 64 phone, the program instantly crash.

Steps to reproduce:

  1. wget "trzsz_1.1.5_linux_aarch64.tar.gz"
  2. tar zxvf trzsz_1.1.5_linux_aarch64.tar.gz
  3. Run: ./trzsz-go ssh remotemachine
  4. Crash
  5. Be sad :(

Any suggestions? Let me know if a dump of the output may help

romanovj commented 1 year ago

build yourself for android

cd ~
go install github.com/trzsz/trzsz-go/cmd/...@latest
go/bin/trzsz -v
lonnywong commented 1 year ago

@marco-trovato tar zxvf trzsz_1.1.5_linux_aarch64.tar.gz

marco-trovato commented 1 year ago

@marco-trovato tar zxvf trzsz_1.1.5_linux_aarch64.tar.gz

You're right @lonnywong, I fixed the steps.


@romanovj:

Thank you for your help, I compiled from the sources and it didn't crash. Improvement! But weirdly it still didn't work when I tried to download a file in the remote machine with tsz.

It's really odd because it works on all other Linux/Windows machines, and I don't know how to troubleshoot it.

lonnywong commented 1 year ago

@marco-trovato You may need to install zenity first.

marco-trovato commented 1 year ago

It seems that pkg search zenity returns nothing on Termux.

The behaviour is so weird because with tsz the filetransfer seems to start, but it immediately freezes until you press CTRL-C. I guess you're right and it could be the destination folder dialogs.

lonnywong commented 1 year ago

Without zenity, you can add a config file ~/.trzsz.conf:

DefaultDownloadPath = /path/to/save/files/

The tsz should work, but trz can't work without zenity.

marco-trovato commented 1 year ago

Ok I created the config file as you suggested: I double-checked and it was a necessary step.

But it wasn't enough: before connecting I also had to wrap the trzsz command around the bash, i.e. by running: trzsz fish

And then it worked! Thank you for your help!!!

lonnywong commented 1 year ago

If you want to make trz work, you can build a script named zenity, call the termux api in it, let the user choose some files, and then output the absolute path of the files to stdout, just like the zenity does in other Linux.

I'm not familiar with the termux api, don't know how to pop up a file picker dialog.

marco-trovato commented 1 year ago

In theory the zenity alternative for Termux is termux-dialog (install it by typing: pkg install termux-api).

And it returns the value in JSON, so you have to parse it with jq like this:

name=$(termux-dialog text -t "Please enter a name" | jq '.text')
echo "$name"

But it's too much assle to understand how to make a workaround: if things gets this complicated I rather use scp instead.

romanovj commented 1 year ago

pkg install x11-repo pkg install zenity

but you will need to start Graphical Environment