[PATCH] Add support for TTY query