Fix: It's not raw mode.

This commit is contained in:
anseki 2015-03-01 15:06:53 +09:00
parent a785f18b76
commit d724dbf5d2
2 changed files with 6 additions and 6 deletions

View file

@ -3,9 +3,9 @@ setlocal
if "%1"=="noechoback" ( if "%1"=="noechoback" (
call :exprog call :exprog
) else ( ) else (
set /p LINE=<CON >CON set /p INPUT=<CON >CON
) )
set /p ="'%LINE%'"<NUL set /p ="'%INPUT%'"<NUL
endlocal endlocal
exit /b 0 exit /b 0
@ -26,5 +26,5 @@ if errorlevel 1 (
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto^($BSTR^)"" [System.Runtime.InteropServices.Marshal]::PtrToStringAuto^($BSTR^)""
) )
:: echo %EXCOMMAND% :: echo %EXCOMMAND%
for /f "usebackq delims=" %%i in (`%EXCOMMAND%`) do set "LINE=%%i" for /f "usebackq delims=" %%i in (`%EXCOMMAND%`) do set "INPUT=%%i"
exit /b exit /b

View file

@ -1,10 +1,10 @@
if [ "$1" = "noechoback" ]; then if [ "$1" = "noechoback" ]; then
stty --file=/dev/tty -echo echonl || stty -F /dev/tty -echo echonl || stty -f /dev/tty -echo echonl || exit 1 stty --file=/dev/tty -echo echonl || stty -F /dev/tty -echo echonl || stty -f /dev/tty -echo echonl || exit 1
IFS= read LINE </dev/tty IFS= read -r INPUT </dev/tty
stty --file=/dev/tty echo -echonl || stty -F /dev/tty echo -echonl || stty -f /dev/tty echo -echonl stty --file=/dev/tty echo -echonl || stty -F /dev/tty echo -echonl || stty -f /dev/tty echo -echonl
# printf '\n' >/dev/tty # printf '\n' >/dev/tty
else else
IFS= read LINE </dev/tty IFS= read -r INPUT </dev/tty
fi fi
printf '%s' "'$LINE'" printf '%s' "'$INPUT'"
exit 0 exit 0