Emulate editor call inside eshell. Also set env $EDITOR to that editing function for tools using it.