Step 1: Go to File >Preferences >Open Keyboard Shortcuts or just press F1 and search “Open Keyboard Shortcuts”.

Step 2: Search for “Terminal: Clear” (by default no keyboard shortcut is assigned).

Step 3: Just click on the Plus (+) icon in the banner or by clicking its row 2 times. Then, give the preferred shortcut of your choice to clear the terminal (I prefer to use ctrl+k as that shortcut is not assigned with any command).

After that you can now try your chosen command.
Reference:
https://stackoverflow.com/questions/48713604/how-can-i-clear-the-terminal-in-visual-studio-code