The game you're describing is the classic Snake. In it, you create a trail wherever you move, growing longer as you go, and the goal is to trap your opponent so they crash into a wall or your line first.
There are plenty of versions with no real size limit, exactly as you remember. You can find playable copies on several websites, though some may ask you to download a file or two before you jump in.