You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve encountered an issue with gotop when running it in Termux on Android. When I specify the absolute path for the layout file using the -l option, gotop is unable to find the file. However, when I run gotop from the directory where the layout file is located, it works as expected.
Here are the steps to reproduce the issue:
Install gotop using the command go install github.com/xxxserxxx/gotop/v4/cmd/gotop@latest.
Create a layout file at /data/data/com.termux/files/home/.config/gotop__manual_config.txt.
Run gotop with the -l option and the absolute path to the layout file: ./gotop -l /data/data/com.termux/files/home/.config/gotop__manual_config.txt.
Expected Result: gotop runs with the specified layout.
Actual Result: gotop is unable to find the layout file and logs the following error: failed to find layout file /data/data/com.termux/files/home/.config/gotop__manual_config.txt: /data/data/com.termux/files/home/go/bin.
OS: Android, Linux localhost 4.14.186+ #1 SMP PREEMPT Thu Mar 17 16:28:22 CST 2022 aarch64
gotop version: gotop 0.0.0 (Hadean)
~/go/bin $ go version
go version go1.22.3 android/arm64
~/go/bin $
It also works identically with default (apt) gotop:
This issue seems to be related to how gotop is handling file paths (maybe due to go language itself? via the path package? me no programmer ...), neither the absolute nor relative paths work. A workaround is to change the directory to the location of the layout file before running gotop, but this is not an ideal solution.
My hack for now: alias gotop='(orig_dir=$(pwd) && cd /data/data/com.termux/files/home/.config && sudo /data/data/com.termux/files/usr/bin/gotop --no-statusbar -l gotop__manual_config.txt && cd $orig_dir)'
The text was updated successfully, but these errors were encountered:
I’ve encountered an issue with gotop when running it in Termux on Android. When I specify the absolute path for the layout file using the -l option, gotop is unable to find the file. However, when I run gotop from the directory where the layout file is located, it works as expected.
Here are the steps to reproduce the issue:
Expected Result: gotop runs with the specified layout.
Actual Result: gotop is unable to find the layout file and logs the following error: failed to find layout file /data/data/com.termux/files/home/.config/gotop__manual_config.txt: /data/data/com.termux/files/home/go/bin.
Without my hack below:
Additional Information:
It also works identically with default (apt) gotop:
This issue seems to be related to how gotop is handling file paths (maybe due to go language itself? via the
path
package? me no programmer ...), neither the absolute nor relative paths work. A workaround is to change the directory to the location of the layout file before running gotop, but this is not an ideal solution.My hack for now:
alias gotop='(orig_dir=$(pwd) && cd /data/data/com.termux/files/home/.config && sudo /data/data/com.termux/files/usr/bin/gotop --no-statusbar -l gotop__manual_config.txt && cd $orig_dir)'
The text was updated successfully, but these errors were encountered: