Explorar o código

Added default input "y" when opening console

Now you just have to press ENTER.

Note that this requires v4 of bash.
Marvin Lehmann %!s(int64=11) %!d(string=hai) anos
pai
achega
da7f3d0b34
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      functions/fn_console

+ 2 - 2
functions/fn_console

@@ -17,7 +17,7 @@ echo "Press \"CTRL+b d\" to exit console."
 fn_printwarningnl "Do NOT press CTRL+c to exit."
 fn_printwarningnl "Do NOT press CTRL+c to exit."
 echo ""
 echo ""
 while true; do
 while true; do
-	read -p "Continue? [y/N]" yn
+	read -e -i "y" -p "Continue? [y/N]" yn
 	case $yn in
 	case $yn in
 	[Yy]* ) break;;
 	[Yy]* ) break;;
 	[Nn]* ) echo Exiting; return 1;;
 	[Nn]* ) echo Exiting; return 1;;
@@ -45,4 +45,4 @@ else
 		* ) echo "Please answer yes or no.";;
 		* ) echo "Please answer yes or no.";;
 	esac
 	esac
 	done
 	done
-fi
+fi