Fix history (and migration) editor path #1163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a command \edit or \e that pulls up an editor to change the last query in the history. It won't work on Windows unless one of the two env vars is set. Unfortunately Windows doesn't have a terminal editor anymore (apparently there used to be one called edit.exe but it's gone now) so the only possible default is pulling up Notepad which is at least better than nothing and works fine.
The second change is from vim to vi on Linux, because that looks to be the default. My WSL for example has vi but not vim, so with the change to vi it will work (doesn't work at the moment). But if vim really is a preferred default then we can keep it that way.
Later noticed that the \migration edit command also pulls up the editor so unified the editor path search into a single function and now that command works in Windows too.