Unity UI Input Help - Waiting Until the User Presses Enter

I have a project set up with a TMP input field. During execution, the game must wait until the user presses enter, and then take whatever’s in the input field as some kind of input, and resume play. I had set up a coroutine to do this, but I’m having trouble getting the coroutine to make the rest of the game wait until the user presses Enter. Right now, the coroutine is waiting for the user to press Enter while the game continues its normal execution. How can I make it so that the game can wait until the user presses Enter before continuing execution?

The way it’s set up now, every time the user presses enter, a script takes the text in the input field and adds it to a List of strings called buffer, and the coroutine waits until the buffer has at least one element in it before continuing and thus allowing the game to take that element in for processing.

This is the coroutine:

public IEnumerator WaitForBufferLength() {
        yield return new WaitUntil(() => buffer.Count > 0);
}

It’s stored in a class called InputManager, which also has this getter method:

public string GetNextFromBuffer {
      get {
            try {
                string tmp = buffer.ElementAt(buffer.Count - 1); buffer.RemoveAt(buffer.Count - 1); return tmp;
            } catch (ArgumentOutOfRangeException) {
                return "";
            }
      }
}

The coroutine is called by this function, which is in a different script:

private string GetInputFromManager() {
        StartCoroutine(inputManager.WaitForBufferLength());
        return inputManager.GetNextFromBuffer;
    }

This function would be used in this way:

string input = GetInputFromManager();

What’s wrong with this?