microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.93k stars 28.46k forks source link

Commit message is lost if you up-arrow once too many times #222005

Open LiveFreeAndRoam opened 1 month ago

LiveFreeAndRoam commented 1 month ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Open a workspace with a git repository
  2. Open the "Source Control" sidebar
  3. Change a file so you can enter a "Commit" message
  4. Type a few lines, then up-arrow to the top of the commit message, then up-arrow one more time
  5. The commit message is lost.
  6. A down-arrow does not restore the previously typed commit message.

This is a data loss scenario, so I treat it as a critical bug.

LiveFreeAndRoam commented 1 month ago

I don't know if this is relevant, but the steps I took to get here...

  1. Committed some code changes, accompanied by a message
  2. Undid the last commit via the VSCode menu item
  3. In the "Commit Message" input field, I edited the commit message
  4. This is when I up-arrowed one too many times and lost the updated message.
lszomoru commented 4 weeks ago

@LiveFreeAndRoam, sorry about that. By arrowing up one too many times I suspect that you mean that you have pressed the up arrow twice: 1) the cursor moves to the beginning of the commit input field, 2) the input gets cleared.

Here is what I tried in order to get the original contents of the input back: 1) Press Ctrl+Z (undo) as that will restore the original contents of the input 2) Press up arrow, press down arrow twice as this will also restore the original contents of the input

Could you give this a try and let me know if these work for you? Thanks!