HiExit code is set after closing one of the output channels. If you close both, the errorcode is reset to 0 again. (This might be a bug though)
my $p = run "ls", "dadsad", :out, :err; say $p.err.lines; ---> (ls: cannot access 'dadsad': No such file or directory) $p.out.close; $p.exitcode; ---> 2 Marcel Timmerman