when you hit up, even if last command was an error, edit it
The most common use case to hit up on the keyboard is that I had a typo in the last command in the shell. When I hit up now, it goes to the most recent valid command not the most recent command.
What it should do is retype the invalid command I last tried to send, regardless of if it was succesful.
AdminMassimiliano (Admin, MongoDB) commented
Could you please provide some more details? Commands that have typos are saved to history in `mongosh` by default.
There are, however, some commands that we don't save on purpose to avoid storing sensitive information in the history file. Here is the regex that excludes commands from history: https://github.com/mongodb-js/mongosh/blob/0dc8f7383f0288f875bfe362f88132853b3a3831/packages/history/src/history.ts#L3