Jack Kamm writes: > Ihor Radchenko writes: > >> The patch generally looks reasonable, although I am slightly concerned >> about interaction between :dir and session we describe in the manual: >> >> When ‘dir’ is used with ‘session’, Org sets the starting directory >> for a new session. But Org does not alter the directory of an already >> existing session. > > I agree it's a problem -- if there are multiple blocks with the same > session but different ":dir" arguments, then a ":file" result of the > second block will be relative to the wrong :dir. > > This seems like a longstanding problem, and affects both async and > non-async session blocks. Maybe something like the attached? > Ideally, ":dir" should be set at session level rather than block > level. This could be done via PROPERTY if there is only one session in > the file or subtree, but there isn't a mechanism for this more > generally. Or we can ask babel backends to respect :dir and issue the necessary "cd" command in the session for the duration of the code block evaluation. > Perhaps the simplest solution is to add a check to org-lint, requiring > all blocks with the same session to have the same :dir. Or this.