Usually when an editor is empty, the editor hides the scroll bar, but when there are just two lines in V.S. Code, the scrollbar is visible. Is there a way to configure V.S. Code so that the scrollbar remains hidden until the number of lines-of-code exceeds the amount of lines that are visible in the editor?

Your not going to be able to get exactly what your looking for, but I will clarify, what you are able to do, and you can decide the best option that works for you. I will attempt to outline the answer to cover the topic in a way that it is useful to anyone else who is looking for the same topic via stack overflow search-queries.
The setting that affects the visibility of the scrollbar is editor.scrollbar.vertical, and it is the only one, however; there is also editor.scrollbar.verticalScrollbarSize which changes the size of the scroll-bar (I guess, as a technicality it can affect its visibility as well, since setting it to 0 hides the scroll-bar).
editor.scrollbar.vertical has 3 settings, and they are as follows.Auto – "Assigning the value auto will hide the scrollbar whenever the editor is not in focus."
Visible – "A better name perhaps, would be "Always Visible", since assigning the value visible always makes the scrollbar visible, even when working in the workbench, or terminal."
Hidden – "I think we can all take a pretty good guess at what assigning hidden does. It hides the scrollbar.... I guess I should point out that this too is a case of "always", as it always hides the scrollbar."
V.S. Code is a highly configurable editor, and I personally love it for that reason, but to be fair; V.S. Code lacks in configurable scrollbar settings, there isn't a lot that can be done to customize it, and this has lead to several issues and suggestions created in the V.S. Code Repository. Perhaps the most appealing aspect to V.S. Code, is there team. The VSC team listens to suggestions, as they deliver when a suggestion is popular, perhaps try creating a suggestion — just remember to make sure no one else has already suggested it.
Check this setting:
Editor > Scrollbar: Vertical
the default is auto, is yours changed to visible?  Which would be always shown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With