This can be done easily by adding $ARGS="$ARGS -b /sbin:/sbin -b /root:/root" which will make magisk's binary directories available under proot.
This issue probably belongs at github.com/termux/proot.
@Grimler91 Actually code of the termux-chroot script is in this repository (https://github.com/termux/termux-packages/blob/master/packages/proot/termux-chroot), so this is the correct place.
Oh, sorry about that @ShadowEO.
May I ask what is use case for this? The only one I can see is ability to use su when you autostart termux-chroot, is this what you need?
Otherwise it doesn't really make sense:
termux-chroot after running tsu (or whatever su wrapper you use); Running su inside termux-chroot will escape chroottermux-chroot just use su instead termux-chrootYou can edit termux-chroot script on device (e.g. vim $(which termux-chroot); changes will be undone after proot package update or pkg install --reinstall proot), then see if change works as intended and if everything is good please send pull request
The reason I was suggesting this, I could not get su, nor tsu to work without adding the arguments in the original request. It would simply not detect su's existence while inside proot and you are indeed correct, I am autostarting termux-chroot. More specifically, I am running the SSH server on-device, then connecting through another more touch-friendly client (Terminus, so I can have the up/down/left/right buttons in the terminal) where sshd starts the chroot for me, then my shell.
I have done the changes on my personal device and have tested them and it works fine, I will send a pull request when I am next on my Nexus 7 to grab the modified script.
As requested, I have sent the pull request, sorry this took so long. I've been rather busy IRL! The pull request should close this issue. It should also be future-proof (barring changes to MagiskSU itself), as even though Android has /root and /sbin available even without MagiskSU installed, I could see them potentially being removed in the future.
I added a conditional to my original version of my changes to ensure that this doesn't cause breakage if for some reason /root and /sbin don't exist on the device. (I checked on my stock LG V20 and they do exist as of 7.1.2, but I figured I may as well be safe since I noticed the conditionals elsewhere for binds.)