I meant setting `curdisp="$tty"` here and removing the if block `if [ -z "$curdisp" ];` below.
Logically equivalent as the for loop will never set an empty `curdisp`.