Treat shell source as bash source.
Refactor cursor position saving.