tramp-terminal-prompt-regexp

tramp-terminal-prompt-regexp is a variable defined in `tramp.el'.
Its value is
"\\(TERM = (.*)\\|Terminal type\\? \\[.*\\]\\)\\s-*"


Documentation:
Regular expression matching all terminal setting prompts.
The regexp should match at end of buffer.
The answer will be provided by `tramp-action-terminal', which see.

You can customize this variable.