Enhanced prompt detection
This commit is contained in:
@ -74,12 +74,37 @@ class command():
|
||||
|
||||
# Add default shell prompt patterns
|
||||
promptPatterns.extend([
|
||||
r'^\s*\\\$\s*$', # Just $ (with whitespace)
|
||||
r'^\s*\$\s*$', # Just $ (with whitespace)
|
||||
r'^\s*#\s*$', # Just # (with whitespace)
|
||||
r'^\s*>\s*$', # Just > (with whitespace)
|
||||
r'.*@.*[\\\$#>]\s*$', # Contains @ and ends with prompt char (user@host style)
|
||||
r'^\[.*\]\s*[\\\$#>]\s*$', # [anything]$ style prompts
|
||||
r'^[a-zA-Z0-9._-]+[\\\$#>]\s*$', # Simple shell names like bash-5.1$
|
||||
|
||||
# Interactive prompt patterns
|
||||
# Package manager confirmation prompts
|
||||
r'.*\?\s*\[[YyNn]/[YyNn]\]\s*$', # ? [Y/n] or ? [y/N] style
|
||||
r'.*\?\s*\[[Yy]es/[Nn]o\]\s*$', # ? [Yes/No] style
|
||||
r'.*\?\s*\([YyNn]/[YyNn]\)\s*$', # ? (Y/n) or ? (y/N) style
|
||||
r'.*\?\s*\([Yy]es/[Nn]o\)\s*$', # ? (Yes/No) style
|
||||
r'.*continue\?\s*\[[YyNn]/[YyNn]\].*$', # "continue? [Y/n]" style
|
||||
r'.*ok\s*\[[YyNn]/[YyNn]\].*$', # "Is this ok [y/N]:" style
|
||||
r'^::.*\?\s*\[[YyNn]/[YyNn]\].*$', # pacman ":: Proceed? [Y/n]" style
|
||||
|
||||
# Authentication prompts
|
||||
r'^\[[Ss]udo\]\s*[Pp]assword\s*for\s+.*:\s*$', # [sudo] password for user:
|
||||
r'^[Pp]assword\s*:\s*$', # Password:
|
||||
r'.*[Pp]assword\s*:\s*$', # general password prompts
|
||||
r".*'s\s*[Pp]assword\s*:\s*$", # user's password:
|
||||
r'^[Ee]nter\s+[Pp]assphrase.*:\s*$', # Enter passphrase:
|
||||
r'^[Pp]lease\s+enter\s+[Pp]assphrase.*:\s*$', # Please enter passphrase:
|
||||
|
||||
# General confirmation and continuation prompts
|
||||
r'^[Pp]ress\s+any\s+key\s+to\s+continue.*$', # Press any key to continue
|
||||
r'^[Aa]re\s+you\s+sure\?\s*.*$', # Are you sure?
|
||||
r'^[Pp]lease\s+confirm.*$', # Please confirm
|
||||
r'.*confirm.*\([YyNn]/[YyNn]\).*$', # confirm (y/n)
|
||||
r'.*\([Yy]/[Nn]\)\s*$', # ends with (Y/n) or (y/N)
|
||||
])
|
||||
|
||||
for pattern in promptPatterns:
|
||||
|
@ -68,12 +68,37 @@ class command():
|
||||
|
||||
# Add default shell prompt patterns
|
||||
promptPatterns.extend([
|
||||
r'^\s*\\\$\s*$', # Just $ (with whitespace)
|
||||
r'^\s*\$\s*$', # Just $ (with whitespace)
|
||||
r'^\s*#\s*$', # Just # (with whitespace)
|
||||
r'^\s*>\s*$', # Just > (with whitespace)
|
||||
r'.*@.*[\\\$#>]\s*$', # Contains @ and ends with prompt char (user@host style)
|
||||
r'^\[.*\]\s*[\\\$#>]\s*$', # [anything]$ style prompts
|
||||
r'^[a-zA-Z0-9._-]+[\\\$#>]\s*$', # Simple shell names like bash-5.1$
|
||||
|
||||
# Interactive prompt patterns
|
||||
# Package manager confirmation prompts
|
||||
r'.*\?\s*\[[YyNn]/[YyNn]\]\s*$', # ? [Y/n] or ? [y/N] style
|
||||
r'.*\?\s*\[[Yy]es/[Nn]o\]\s*$', # ? [Yes/No] style
|
||||
r'.*\?\s*\([YyNn]/[YyNn]\)\s*$', # ? (Y/n) or ? (y/N) style
|
||||
r'.*\?\s*\([Yy]es/[Nn]o\)\s*$', # ? (Yes/No) style
|
||||
r'.*continue\?\s*\[[YyNn]/[YyNn]\].*$', # "continue? [Y/n]" style
|
||||
r'.*ok\s*\[[YyNn]/[YyNn]\].*$', # "Is this ok [y/N]:" style
|
||||
r'^::.*\?\s*\[[YyNn]/[YyNn]\].*$', # pacman ":: Proceed? [Y/n]" style
|
||||
|
||||
# Authentication prompts
|
||||
r'^\[[Ss]udo\]\s*[Pp]assword\s*for\s+.*:\s*$', # [sudo] password for user:
|
||||
r'^[Pp]assword\s*:\s*$', # Password:
|
||||
r'.*[Pp]assword\s*:\s*$', # general password prompts
|
||||
r".*'s\s*[Pp]assword\s*:\s*$", # user's password:
|
||||
r'^[Ee]nter\s+[Pp]assphrase.*:\s*$', # Enter passphrase:
|
||||
r'^[Pp]lease\s+enter\s+[Pp]assphrase.*:\s*$', # Please enter passphrase:
|
||||
|
||||
# General confirmation and continuation prompts
|
||||
r'^[Pp]ress\s+any\s+key\s+to\s+continue.*$', # Press any key to continue
|
||||
r'^[Aa]re\s+you\s+sure\?\s*.*$', # Are you sure?
|
||||
r'^[Pp]lease\s+confirm.*$', # Please confirm
|
||||
r'.*confirm.*\([YyNn]/[YyNn]\).*$', # confirm (y/n)
|
||||
r'.*\([Yy]/[Nn]\)\s*$', # ends with (Y/n) or (y/N)
|
||||
])
|
||||
|
||||
for pattern in promptPatterns:
|
||||
|
@ -4,5 +4,5 @@
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
version = "2025.06.07"
|
||||
version = "2025.06.08"
|
||||
codeName = "testing"
|
||||
|
Reference in New Issue
Block a user