One of the main reasons to use history is the ability to correct mistakes.
When used with validation, history is appended after validation, so the input not passing it doesn't end up in history.
Therefore, the user needs to re-type the whole text.
With this PR, history is written before input validation, so we have a complete history. This behavior is in line with tools like bash.
One of the main reasons to use
history
is the ability to correct mistakes. When used with validation, history is appended after validation, so the input not passing it doesn't end up in history. Therefore, the user needs to re-type the whole text.With this PR, history is written before input validation, so we have a complete history. This behavior is in line with tools like
bash
.