If the console buffer is small, we sometimes tried to move the cursor outside the buffer when displaying possible completions or the completion menu. The fix: * avoids displaying the tooltip if it doesn't fit in the buffer * places the cursor without scrolling when simply printing the completions (no menu selection)