What is this yellow line with a dot at the end? I think I have entered a sequence of commands as a mistake and now a yellow line appears in top of my selection.
I don't know what it is for or how to enable/disable it.

I have tried closing the editor but it keeps appearing.
You've simply activated a tool from the toolbox on the left. You can see wich tool you have selected by the blue background on it.
If you don't see that toolbox, simply hit T while your cursor is hovering over your 3D viewport, or drag the little arrow on the top-left part of the viewport.

The default tool is Rectangle Selection (the top-most one), click it.