@alloydflanagan wrote this up here:
schpet.com/note/editing-shell-

so happy to figure this out