Jack, I can confirm that this works on my setup in each of the scenarios in which `default-directory' got set correctly in the session buffer.
At some point, my default-directory got reset to drop the tramp prefix "/scp:/user@host:" in one session after faithfully running the src block several times. I am unable to sort out why or even reproduce this. Chuck > On Sep 7, 2020, at 1:07 PM, Jack Kamm <jackk...@gmail.com> wrote: > > Hi Chuck, > >> This does not work for my remote session. > > Thanks for testing this. > > The remote tests I originally tried did not cover this case -- I only > tested the case where both org-file and session were remote, but didn't > test the case where org-file was local and session was remote. > > I've now tested this case as well, and added some fixes for it. I'm > reattaching the patch in full. > > However, this implementation does require the R session to have the > correct default-directory -- see details below.