I would like to second the request. The suggested workaround is quite a lot of extra work and not very smooth for repeating lots of edit/test cycles. It also puts tempfile naming and eventual cleanup on the user. PostgreSQL's `psql` command has a great `\e` feature for combining the above. Perhaps it could be a source of inspiration... .edit [FILENAME] With no FILENAME the `.edit` command could put the last SQL command in a temp file to edit and execute. This would also have the advantage of putting actual SQL in shell history instead of uninformative `.shell` and `.read` commands. Such a syntax would be particularly useful given the SQLite shell's command history being per _line_ instead of per _command_ like most other shells. Re-running a previously multi-line command in SQLite is quite a counting exercise (5 times up & return, 5 times up & return, 5 times up & edit & return, 5 times up,...) Perhaps that deserves a whole feature thread on its own.