+#
+# Sigh. Different readline versions change echoing behavior, so we need
+# to deal.
+#
+
+set +e
+whatnowtest="$(echo cd | TERM=dumb whatnow -prompt '')"
+set -e
+
+case "${whatnowtest}" in
+ cd) cat > "$expected" <<EOF
+attach $testname_quoted
+alist
+$testname
+detach $testname_quoted
+alist
+EOF
+ break;;
+ "") cat > "$expected" <<EOF