(dirtrack): Check for the prompt in the input string instead of the buffer.