Modules for Elvish Shell
at main 245 B view raw
1use os 2use str 3use file 4 5fn y {|@argv| 6 var tmp = (os:temp-file) 7 yazi $@argv --cwd-file=$tmp[name] 8 var cwd = (str:trim-space (slurp < $tmp)) 9 file:close $tmp 10 os:remove $tmp[name] 11 if (and (not-eq $cwd '') (not-eq $cwd $pwd)) { 12 cd $cwd 13 } 14}