When the user set with -U {uid}, jexec properly sets the HOME environment variable, but doesn't chdir into this directory, and runs the command in /.
Actually, there is an undocumented argument -l (clean) which does what the subject asks, and which needs to be documented in the man page.
Hi, yuri! I see man page contains "-l" parameter according to: https://svnweb.freebsd.org/base?view=revision&revision=285420 Is it not enough? Thanks!
^Triage: the related option seems to be documented.
jexec(8) has -l in 14-CURRENT, but not in 12.2-STABLE. But this is a minor thing.