1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 09:20:08 +00:00

Merge pull request #318 from NanmiCoder/main

fix: resolve password input issue with special characters
This commit is contained in:
Tw93
2026-01-15 14:34:25 +08:00
committed by GitHub
2 changed files with 4 additions and 6 deletions

View File

@@ -66,11 +66,11 @@ _request_password() {
printf "${PURPLE}${ICON_ARROW}${NC} Password: " > "$tty_path" printf "${PURPLE}${ICON_ARROW}${NC} Password: " > "$tty_path"
# Disable terminal echo to hide password input # Disable terminal echo to hide password input (keep canonical mode for reliable input)
stty -echo -icanon min 1 time 0 < "$tty_path" 2> /dev/null || true stty -echo < "$tty_path" 2> /dev/null || true
IFS= read -r password < "$tty_path" || password="" IFS= read -r password < "$tty_path" || password=""
# Restore terminal echo immediately # Restore terminal echo immediately
stty echo icanon < "$tty_path" 2> /dev/null || true stty echo < "$tty_path" 2> /dev/null || true
printf "\n" > "$tty_path" printf "\n" > "$tty_path"

View File

@@ -123,8 +123,6 @@ remove_login_item() {
fi fi
} }
# Remove files (handles symlinks, optional sudo). # Remove files (handles symlinks, optional sudo).
remove_file_list() { remove_file_list() {
local file_list="$1" local file_list="$1"